mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 19:53:32 +08:00
Update.
2003-03-26 Ulrich Drepper <drepper@redhat.com> * abilist/librt.abilist: Add new timer interfaces for 64-bit archs.
This commit is contained in:
parent
bdb6126c2d
commit
f064e4c5d7
@ -1,3 +1,7 @@
|
||||
2003-03-26 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* abilist/librt.abilist: Add new timer interfaces for 64-bit archs.
|
||||
|
||||
2003-03-25 Jiro SEKIBA <jir@yamato.ibm.com>
|
||||
|
||||
* iconvdata/euc-tw.c (from_euc_tw): Fix return value of TO_LOOP.
|
||||
|
@ -37,3 +37,10 @@ GLIBC_2.2.5 x86_64-.*-linux.*
|
||||
timer_settime F
|
||||
GLIBC_2.2 i.86-.*-linux.* ia64-.*-linux.* powerpc-.*-linux.* s390-.*-linux.* sh[34].*-.*-linux.*
|
||||
GLIBC_2.2 A
|
||||
GLIBC_2.3.3 ia64-.*-linux.* powerpc64-.*-linux.* s390x-.*-linux.* x86_64-.*-linux.*
|
||||
GLIBC_2.3.3 A
|
||||
timer_create F
|
||||
timer_delete F
|
||||
timer_getoverrun F
|
||||
timer_gettime F
|
||||
timer_settime F
|
||||
|
@ -1,3 +1,8 @@
|
||||
2003-03-26 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
|
||||
NULL provide default definition to syscall.
|
||||
|
||||
2003-03-25 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
|
||||
|
@ -60,6 +60,30 @@ timer_create (clock_id, evp, timerid)
|
||||
if (evp == NULL
|
||||
|| __builtin_expect (evp->sigev_notify != SIGEV_THREAD, 1))
|
||||
{
|
||||
struct sigevent local_evp;
|
||||
|
||||
/* We avoid allocating too much memory by basically
|
||||
using struct timer as a derived class with the
|
||||
first two elements being in the superclass. We only
|
||||
need these two elements here. */
|
||||
struct timer *newp = (struct timer *) malloc (offsetof (struct timer,
|
||||
thrfunc));
|
||||
if (newp == NULL)
|
||||
/* No more memory. */
|
||||
return -1;
|
||||
|
||||
if (evp == NULL)
|
||||
{
|
||||
/* The kernel has to pass up the timer ID which is a
|
||||
userlevel object. Therefore we cannot leave it up to
|
||||
the kernel to determine it. */
|
||||
local_evp.sigev_notify = SIGEV_SIGNAL;
|
||||
local_evp.sigev_signo = SIGALRM;
|
||||
local_evp.sigev_value.sival_ptr = newp;
|
||||
|
||||
evp = &local_evp;
|
||||
}
|
||||
|
||||
kernel_timer_t ktimerid;
|
||||
int retval = INLINE_SYSCALL (timer_create, 3, clock_id, evp,
|
||||
&ktimerid);
|
||||
@ -70,43 +94,31 @@ timer_create (clock_id, evp, timerid)
|
||||
{
|
||||
# ifndef __ASSUME_POSIX_TIMERS
|
||||
__no_posix_timers = 1;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
if (retval != -1)
|
||||
{
|
||||
struct timer *newp;
|
||||
newp->sigev_notify = (evp != NULL
|
||||
? evp->sigev_notify : SIGEV_SIGNAL);
|
||||
newp->ktimerid = ktimerid;
|
||||
|
||||
/* We avoid allocating too much memory by basically
|
||||
using struct timer as a derived class with the
|
||||
first two elements being in the superclass. We only
|
||||
need these two elements here. */
|
||||
newp = (struct timer *) malloc (offsetof (struct timer,
|
||||
thrfunc));
|
||||
if (newp != NULL)
|
||||
{
|
||||
newp->sigev_notify = (evp != NULL
|
||||
? evp->sigev_notify
|
||||
: SIGEV_SIGNAL);
|
||||
newp->ktimerid = ktimerid;
|
||||
|
||||
*timerid = (timer_t) newp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No memory. Free the kernel timer. */
|
||||
INTERNAL_SYSCALL_DECL (err);
|
||||
(void) INTERNAL_SYSCALL (timer_delete, err, 1, ktimerid);
|
||||
|
||||
retval = -1;
|
||||
}
|
||||
*timerid = (timer_t) newp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Cannot allocate the timer, fail. */
|
||||
free (newp);
|
||||
retval = -1;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
free (newp);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef __ASSUME_POSIX_TIMERS
|
||||
# ifndef __ASSUME_POSIX_TIMERS
|
||||
/* Make sure we have the necessary kernel support. */
|
||||
if (__no_posix_timers == 0)
|
||||
{
|
||||
@ -118,7 +130,7 @@ timer_create (clock_id, evp, timerid)
|
||||
}
|
||||
|
||||
if (__no_posix_timers > 0)
|
||||
#endif
|
||||
# endif
|
||||
{
|
||||
sigset_t ss;
|
||||
sigemptyset (&ss);
|
||||
|
Loading…
Reference in New Issue
Block a user