summaryrefslogtreecommitdiff
path: root/lang/gnat/files/5fosinte.adb
diff options
context:
space:
mode:
Diffstat (limited to 'lang/gnat/files/5fosinte.adb')
-rw-r--r--lang/gnat/files/5fosinte.adb75
1 files changed, 58 insertions, 17 deletions
diff --git a/lang/gnat/files/5fosinte.adb b/lang/gnat/files/5fosinte.adb
index 12febc4d3ddc..e449cf5bf733 100644
--- a/lang/gnat/files/5fosinte.adb
+++ b/lang/gnat/files/5fosinte.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- (Version for new GNARL) --
-- --
--- $Revision: 1.1 $ --
+-- $Revision: 1.2 $ --
-- --
-- Copyright (C) 1991,1992,1993,1994,1995,1996 Florida State University --
-- --
@@ -39,7 +39,7 @@
-- This is only a first approximation.
-- It should be autogenerated by the m4 macro processor.
--- Contributed by Daniel M. Eischen (deischen@iworks.InterWorks.org)
+-- Contributed by Daniel M. Eischen (eischen@vigrid.com)
-- DO NOT EDIT this file.
-- It was automatically generated from another file by the m4 macro processor.
@@ -56,10 +56,10 @@
-- __HAS_SIGCONTEXT = 1
-- __HAS_UCONTEXT = 0
-- __THREADS = POSIX_THREADS
--- __THREAD_VARIANT = ??
+-- __THREAD_VARIANT = MIT-THREADS
-- __HAS_TIMESPEC = 1
-- __HAS_NANOSLEEP = 1
--- __HAS_CLOCK_GETTIME = 0
+-- __HAS_CLOCK_GETTIME = 1
-- __HAS_GETTIMEOFDAY = 1
-- __POSIX_THREAD_PRIO_PROTECT = 0
-- __POSIX_THREAD_PRIO_INHERIT = 0
@@ -86,8 +86,61 @@ package body System.OS_Interface is
return (internal_errno.all);
end Errno;
+ function Get_Stack_Base (thread : pthread_t) return Address is
+ begin
+ return (0);
+ end Get_Stack_Base;
+
+ function pthread_getschedparam
+ (thread : pthread_t;
+ policy : access int;
+ param : access struct_sched_param) return int is
- type sigset_t_ptr is access all sigset_t;
+ function pthread_getprio (thread : pthread_t) return int;
+ pragma Import (C, pthread_getprio, "pthread_getprio");
+
+ Result : int;
+ begin
+ Result := pthread_getprio (thread);
+ if Result >= 0 then
+ -- Only set sched_param if we succeeded. Also ensure
+ -- we return a successful status to the caller.
+ param.sched_priority := Result;
+ Result := 0;
+ end if;
+ return (Result);
+ end pthread_getschedparam;
+
+ function pthread_setschedparam
+ (thread : pthread_t;
+ policy : int;
+ param : access struct_sched_param) return int is
+
+ function pthread_setprio (thread : pthread_t; prio : int) return int;
+ pragma Import (C, pthread_setprio, "pthread_setprio");
+
+ begin
+ return (pthread_setprio (thread, param.sched_priority));
+ end pthread_setschedparam;
+
+ function pthread_attr_setschedpolicy
+ (attr : access pthread_attr_t;
+ policy : int) return int is
+ begin
+ return (0);
+ end pthread_attr_setschedpolicy;
+
+ function pthread_attr_getschedpolicy
+ (attr : access pthread_attr_t;
+ policy : access int) return int is
+ begin
+ return (0);
+ end pthread_attr_getschedpolicy;
+
+ procedure pthread_init is
+ begin
+ null;
+ end pthread_init;
function pthread_sigmask_set
(how : int;
@@ -166,16 +219,4 @@ package body System.OS_Interface is
tv_usec => long (Long_Long_Integer (F * 10#1#E6)));
end To_Timeval;
- -- FreeBSD Pthreads has pthread_yield and it is imported as
- -- sched_yield in 5fosinte.ads. The FreeBSD pthread_yield does
- -- not have any parameters, so the import may be used directly
- -- without the need for a wrapper as shown below.
--- function sched_yield return int is
--- procedure sched_yield_base (arg : System.Address);
--- pragma Import (C, sched_yield_base, "pthread_yield");
--- begin
--- sched_yield_base (System.Null_Address);
--- return 0;
--- end sched_yield;
-
end System.OS_Interface;