[0] http://docs.sun.com/app/docs/doc/819-2243/rwlock-init-3c?a=view
+nsswitch:
+
+ nss_search
+
+ This is used to search a database given a key. Examples that use nss_search
+ include gethostbyname_r and _getauthattr.
+
+ nss_getent
+ nss_setent
+ nss_endent
+ nss_delete
+
+ These are used when for iterating over a database. nss_getent, nss_sent,
+ and nss_endent are used in gethostent, sethostent, and endhostent,
+ respectively. nss_delete is used to free resources used by the interation;
+ it usually directly follows a call to nss_endent.
+
+ _nss_XbyY_fgets
+
+ This function is used to parse a file directly, rather than going through
+ nsswitch.conf and its databases.
+
sysconf:
Many of the _SC_ sysconf values are obtained via the systemconf syscall. The
gethomelgroup
atomic_*
_ttyname_dev
+ pthread_key_create_once_np
+ pthread_mutex_reltimedlock_np
+ pthread_rwlock_reltimedrdlock_np
+ pthread_rwlock_reltimedwrlock_np
Insert into headers:
resolvpath (unistd.h)
issetugid (unistd.h)
getvmusage (sys/vm_usage.h)
str2sig, sig2str (signal.h)
+ sigsend, sigsendset (signal.h)
getexecname (stdlib.h)
lltostr, ulltostr (stdlib.h)
fdwalk, closefrom (stdlib.h)
More clocks in pthread_condattr_setclock
Use timer_* syscalls
+
+Fix forward.c to include mutex_* and thr_main
+ thr_main should return -1 when libpthread.so is not linked in
/* Stop or continue the entire process. */
-extern ps_err_e ps_pstop (const struct ps_prochandle *);
-extern ps_err_e ps_pcontinue (const struct ps_prochandle *);
+extern ps_err_e ps_pstop (struct ps_prochandle *);
+extern ps_err_e ps_pcontinue (struct ps_prochandle *);
/* Stop or continue the given LWP alone. */
-extern ps_err_e ps_lstop (const struct ps_prochandle *, lwpid_t);
-extern ps_err_e ps_lcontinue (const struct ps_prochandle *, lwpid_t);
+extern ps_err_e ps_lstop (struct ps_prochandle *, lwpid_t);
+extern ps_err_e ps_lcontinue (struct ps_prochandle *, lwpid_t);
__END_DECLS
arguments to the option '\0'. This behavior is specific to the GNU
`getopt'. */
-#ifdef __GNU_LIBRARY__
+#ifndef __SUN_COMPAT_MODE
+# ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW;
-#else /* not __GNU_LIBRARY__ */
+# else /* not __GNU_LIBRARY__ */
extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
+# endif
+#else
+extern int __getopt_sun (int ___argc, char *const *___argv,
+ const char *__shortopts)
+ __THROW;
+# ifdef __REDIRECT
+extern int __REDIRECT (getopt, (int ___argc, char *const *___argv,
+ const char *__shortopts), __getopt_sun)
+ __THROW;
+# else
+# define getopt __getopt_sun
+# endif
+#endif /* __SUN_COMPAT_MODE */
#ifndef __need_getopt
extern int getopt_long (int ___argc, char *const *___argv,
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
+# ifndef __SUN_COMPAT_MODE
extern int getpwent_r (struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
+# else
+extern struct passwd * __getpwent_r_sun (struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen);
+# ifdef __REDIRECT
+extern struct passwd * __REDIRECT (getpwent_r, (
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen), __getpwent_r_sun);
+# else
+# define getpwent_r __getpwent_r_sun
+# endif
+# endif
# endif
+# ifndef __SUN_COMPAT_MODE
extern int getpwuid_r (__uid_t __uid,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
+# else
+extern struct passwd * __getpwuid_r_sun (__uid_t __uid,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen);
+# ifdef __REDIRECT
+extern struct passwd * __REDIRECT (getpwuid_r, (__uid_t __uid,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen), __getpwuid_r_sun);
+# else
+# define getpwuid_r __getpwuid_r_sun
+# endif
+# endif
+# ifndef __SUN_COMPAT_MODE
extern int getpwnam_r (__const char *__restrict __name,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
+# else
+extern struct passwd * __getpwnam_r_sun (__const char *__restrict __name,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen);
+# ifdef __REDIRECT
+extern struct passwd * __REDIRECT (getpwnam_r, (__const char *__restrict __name,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen), __getpwnam_r_sun);
+# else
+# define getpwnam_r __getpwnam_r_sun
+# endif
+# endif
# ifdef __USE_SVID
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
+# ifndef __SUN_COMPAT_MODE
extern int fgetpwent_r (FILE *__restrict __stream,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
+# else
+extern struct passwd * __fgetpwent_r_sun (FILE *__restrict __stream,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen);
+# ifdef __REDIRECT
+extern struct passwd * __REDIRECT (fgetpwent_r, (FILE *__restrict __stream,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen), __fgetpwent_r_sun);
+# else
+# define fgetpwent_r __fgetpwent_r_sun
+# endif
+# endif
# endif
#endif /* POSIX or reentrant */
privP modctl acl facl lltostr ulltostr deflt _getauthnam _getauthattr \
_getprofnam _getprofattr _getusernam _getuserattr _getauuserent \
_getauusernam vfsent fdwalk closefrom ipsecalg gethostent sigsendset \
- sigsend stack_getbounds thr_sighndlrinfo
+ sigsend stack_getbounds thr_sighndlrinfo sun_compat mkdev
sysdep_routines += sys_fdsync sys_brk sys_fcntl sys_utssys sys_lwp_private \
sys_uname sys_getloadavg sys_utimes sys_getpeerucred sys_ucred_get \
sys_privsys sys_putmsg sys_putpmsg sys_meminfo sys_pset_getloadavg \
getacct; _getauuserent; _getauusernam; _getauthattr; _getauthnam; getcpuid;
getexecname; gethrtime; gethrvtime; getextmntent; getipnodebyaddr;
getipnodebyname; getipsecalgbyname; getipsecalgbynum; getmntany; getmntent;
- getpagesizes; getpagesizes2; getpeerucred; getpflags; getppriv;
- getprivimplinfo; _getprofattr; _getprofnam; getprojid; getrctl; gettaskid;
+ __getopt_sun; getpagesizes; getpagesizes2; getpeerucred; getpflags;
+ getppriv; getprivimplinfo; _getprofattr; _getprofnam; getprojid;
+ __getpwent_r_sun; __getpwnam_r_sun; __getpwuid_r_sun; getrctl; gettaskid;
_getuserattr; _getusernam; getustack; getvfsany; getvfsent; getvfsfile;
getvfsspec; getvmusage; getzoneid; getzoneidbyname; getzonenamebyid;
_link_aton; _link_ntoa; llseek; lltostr;
# m
- membar_enter; membar_exit; membar_producer; membar_consumer; memcntl;
- meminfo; modctl; mount;
+ __makedev; __major; membar_enter; membar_exit; membar_producer;
+ membar_consumer; memcntl; meminfo; __minor; modctl; mount;
# n
- ntp_adjtime; ntp_gettime;
+ nss_delete; nss_endent; nss_getent; nss_search; nss_setent;
+ _nss_XbyY_fgets; ntp_adjtime; ntp_gettime;
# p
pc_sample; p_online; priocntl; priocntlset; __priv_bracket;
};
#define __need_timeval
+#define __need_itimerval
#include <bits/time.h> /* For `struct timeval'. */
/* Structure which says how much of each resource has been used. */
# endif /* bits/time.h */
#endif
+#if defined (__need_itimerval) && !defined (__need_timeval)
+# define __need_timeval
+#endif
+
#ifdef __need_timeval
# undef __need_timeval
# ifndef _STRUCT_TIMEVAL
# endif /* struct timeval */
#endif /* need timeval */
+# if defined (__need_itimerval) && !defined (__itimerval_defined)
+struct itimerval
+ {
+ /* Value to put into `it_value' when the timer expires. */
+ struct timeval it_interval;
+ /* Time to the next timer expiration. */
+ struct timeval it_value;
+ };
+# define __itimerval_defined
+# undef __need_itimerval
+# endif
+
#ifndef __time_misc_defined
typedef struct timespec timespec_t;
--- /dev/null
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sys/types.h>
+#include <errno.h>
+#include <mkdevP.h>
+
+major_t __major (const int version, const dev_t devnum)
+{
+ if ((version != OLDDEV && version != NEWDEV) || devnum == NODEV)
+ {
+ __set_errno (EINVAL);
+ return NODEV;
+ }
+
+ if (version == OLDDEV)
+ {
+ if ((devnum >> ONBITSMINOR) > OMAXMAJ)
+ {
+ __set_errno (EINVAL);
+ return NODEV;
+ }
+
+ return devnum >> ONBITSMINOR;
+ }
+ else /* NEWDEV */
+ {
+ if ((devnum >> NBITSMINOR) > MAXMAJ)
+ {
+ __set_errno (EINVAL);
+ return NODEV;
+ }
+
+ return devnum >> NBITSMINOR;
+ }
+}
+
+
+minor_t __minor (const int version, const dev_t devnum)
+{
+ if ((version != OLDDEV && version != NEWDEV) || devnum == NODEV)
+ {
+ __set_errno (EINVAL);
+ return NODEV;
+ }
+
+ if (version == OLDDEV)
+ return devnum & OMAXMIN;
+ else /* NEWDEV */
+ return devnum & MAXMIN;
+}
+
+
+dev_t __makedev (const int version, const major_t majdev, const minor_t mindev)
+{
+ if (version != OLDDEV && version != NEWDEV)
+ {
+ __set_errno (EINVAL);
+ return NODEV;
+ }
+
+ if (version == OLDDEV)
+ {
+ if (majdev > OMAXMAJ || mindev > OMAXMIN)
+ {
+ __set_errno (EINVAL);
+ return NODEV;
+ }
+ return (majdev << ONBITSMINOR) | mindev;
+ }
+ else /* NEWDEV */
+ {
+ if (majdev > MAXMAJ || mindev > MAXMIN)
+ {
+ __set_errno (EINVAL);
+ return NODEV;
+ }
+
+ dev_t devnum = (majdev << NBITSMINOR) | mindev;
+ if (devnum == NODEV)
+ __set_errno (EINVAL);
+ return devnum;
+ }
+}
--- /dev/null
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MKDEVP_H
+#define _MKDEVP_H
+
+#include <sys/feature_tests.h>
+
+#define ONBITSMAJOR 7
+#define ONBITSMINOR 8
+#define OMAXMAJ 0x7f
+#define OMAXMIN 0xff
+
+#ifdef _LP64
+# define NBITSMAJOR 32
+# define NBITSMINOR 32
+# define MAXMAJ 0xfffffffful
+# define MAXMIN 0xfffffffful
+#else
+# define NBITSMAJOR 14
+# define NBITSMINOR 18
+# define MAXMAJ 0x3ffful
+# define MAXMIN 0x3fffful
+#endif
+
+#define OLDDEV 0
+#define NEWDEV 1
+
+#endif /* _MKDEVP_H */
--- /dev/null
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <pwd.h>
+#include <unistd.h>
+
+struct passwd * __getpwnam_r_sun (const char *name, struct passwd *pwbuf,
+ char *buf, size_t buflen)
+{
+ struct passwd *bufp;
+ return (getpwnam_r (name, pwbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
+}
+
+struct passwd * __getpwuid_r_sun (uid_t uid, struct passwd *pwbuf, char *buf,
+ size_t buflen)
+{
+ struct passwd *bufp;
+ return (getpwuid_r (uid, pwbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
+}
+
+struct passwd * __getpwent_r_sun (struct passwd *pwbuf, char *buf, size_t buflen)
+{
+ struct passwd *bufp;
+ return (getpwent_r (pwbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
+}
+
+struct passwd * __fgetpwent_r_sun (FILE *fp, struct passwd *pwbuf, char *buf,
+ size_t buflen)
+{
+ struct passwd *bufp;
+ return (fgetpwent_r (fp, pwbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
+}
+
+#if 0
+int __getopt_sun (int argc, char * const argv[], const char *optstring)
+{
+ // TODO
+}
+#endif
02111-1307 USA. */
#include <stdint.h>
+#include <signal.h>
+
+extern void __sighandler (int, siginfo_t *, void *);
+extern void __sighandler_end (void);
void thr_sighndlrinfo (void (**func)(void), int *funcsize)
{
- *func = &__sighandler;
+ *func = (void (*)(void))&__sighandler;
*funcsize = (int)((uintptr_t)&__sighandler_end - (uintptr_t)&__sighandler);
}
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
-#include <bits/regset.h>
+#include <sys/ucontext.h>
/* This is the same as mcontext_t. */
/* Type of the second argument to `getitimer' and
the second and third arguments `setitimer'. */
+#ifndef __itimerval_defined
struct itimerval
{
/* Value to put into `it_value' when the timer expires. */
/* Time to the next timer expiration. */
struct timeval it_value;
};
+# define __itimerval_defined
+#endif
#if defined __USE_GNU && !defined __cplusplus
/* Use the nicer parameter type only in GNU mode and not for C++ since the