#endif
/* If _SUN_SOURCE was defined by the user we enable Sun compatibility mode. */
-#ifdef _SUN_SOURCE
+#if defined (_SUN_SOURCE) && !defined (_POSIX_PTHREAD_SEMANTICS)
# undef __SUN_COMPAT_MODE
# define __SUN_COMPAT_MODE 1
#endif
# solaris threads/synch
libpthread-routines += mutex_init mutex_lock mutex_trylock mutex_unlock \
- mutex_destroy mutex_timedlock mutex_consistent _mutex_held \
- cond_init cond_wait cond_timedwait cond_reltimedwait cond_signal \
- cond_broadcast cond_destroy rwlock_init rwlock_destroy rw_rdlock \
- rw_wrlock rw_unlock rw_tryrdlock rw_trywrlock rw_timedrdlock \
+ mutex_destroy mutex_timedlock mutex_reltimedlock mutex_consistent \
+ _mutex_held cond_init cond_wait cond_timedwait cond_reltimedwait \
+ cond_signal cond_broadcast cond_destroy rwlock_init rwlock_destroy \
+ rw_rdlock rw_wrlock rw_unlock rw_tryrdlock rw_trywrlock rw_timedrdlock \
rw_timedwrlock sema_init sema_destroy sema_wait sema_trywait sema_post \
sema_timedwait thr_create thr_join thr_exit thr_self thr_main thr_yield \
thr_sigsetmask thr_getspecific thr_setspecific thr_keycreate \
thr_keycreate_once thr_min_stack thr_getconcurrency thr_setconcurrency \
thr_continue thr_suspend thr_getprio thr_setprio thr_stksegment \
- _lwp_sema_init _lwp_info __nthreads
+ _lwp_sema_init _lwp_info __nthreads pthread_cond_reltimedwait_np \
+ pthread_mutex_reltimedlock_np
endif
ifeq ($(subdir),posix)
__nthreads;
# p
- pthread_cond_reltimedwait_np;
+ pthread_cond_reltimedwait_np; pthread_mutex_reltimedlock_np;
+ pthread_rwlock_reltimedrdlock_np; pthread_rwlock_reltimedwrlock_np;
# r
rwlock_init; rwlock_destroy; rw_rdlock; rw_wrlock; rw_unlock; rw_tryrdlock;
#include <errno.h>
#include <time.h>
#include <synchP.h>
-#include <abstime-to-reltime.h>
DECLARE_INLINE_SYSCALL (int, lwp_mutex_timedlock, mutex_t *lp,
struct timespec *tsp);
extern int __mutex_lock_fast (mutex_t *mutex, bool try);
-int __mutex_timedlock (mutex, abstime)
+int __mutex_reltimedlock (mutex, reltime)
mutex_t *mutex;
- const struct timespec *abstime;
+ const struct timespec *reltime;
{
/* Handle inconsistent robust mutexes. */
if ((mutex->mutex_type & LOCK_ROBUST) &&
}
/* Reject invalid timeouts. */
- if (INVALID_TIMESPEC (abstime))
+ if (INVALID_TIMESPEC (reltime))
return EINVAL;
- struct timespec _reltime;
- struct timespec *reltime = abstime_to_reltime (abstime, &_reltime);
- if (reltime && reltime->tv_sec < 0)
- return ETIME;
-
int errval;
do
errval = INLINE_SYSCALL (lwp_mutex_timedlock, 2, mutex, reltime);
{
/* We aren't an error checking mutex so we need to block. */
INTERNAL_SYSCALL_DECL (err);
- if (abstime)
+ if (reltime)
{
int result = INTERNAL_SYSCALL (nanosleep, err, 2, reltime, reltime);
do
extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
__const struct timespec *__restrict
__abstime) __THROW __nonnull ((1, 2));
+extern int pthread_mutex_reltimedlock (pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __reltime) __THROW __nonnull ((1, 2));
#endif
/* Unlock a mutex. */
/* These functions are used to implement the "real" associated functions. */
extern int __cond_reltimedwait_internal (cond_t *cond, mutex_t *mutex,
struct timespec *reltime, int cancel);
+extern int __mutex_reltimedlock (mutex_t *mutex,
+ const struct timespec *reltime);
extern int __mutex_timedlock (mutex_t *mutex, const struct timespec *abstime);
extern int __rw_timedrdlock (rwlock_t *rwlock, struct timespec *abstime);
extern int __rw_timedwrlock (rwlock_t *rwlock, struct timespec *abstime);
cancellation point. But due to similarity with an POSIX interface
or due to the implementation they are cancellation points and
therefore not marked with __THROW. */
+# ifndef __SUN_COMPAT_MODE
extern int getprotoent_r (struct protoent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct protoent **__restrict __result);
struct protoent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct protoent **__restrict __result);
+# else
+extern struct protoent * __getprotoent_r_sun (
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern struct protoent * __getprotobyname_r_sun (
+ __const char *__restrict __name,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen);
+
+extern struct protoent * __getprotobynumber_r_sun (int __proto,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen);
+# ifdef __REDIRECT
+extern struct protoent * __REDIRECT (getprotoent_r, (
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result), __getprotoent_r_sun);
+
+extern struct protoent * __REDIRECT (getprotobyname_r, (
+ __const char *__restrict __name,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen),
+ __getprotobyname_r_sun);
+
+extern struct protoent * __REDIRECT (getprotobynumber_r, (int __proto,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen),
+ __getprotobynumber_r_sun);
+# else
+# define getprotobynumber_r __getprotobynumber_r_sun
+# define getprotobyname_r __getprotobyname_r_sun
+# define getprotobynumber_r __getprotobynumber_r_sun
+# endif
+# endif
/* Establish network group NETGROUP for enumeration.
This function is a cancellation point and therefore not marked with
__THROW. */
+# ifndef __SUN_COMPAT_MODE
extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
__nonnull ((1, 2));
+# else
+extern int __sigwait_sun (sigset_t * __set)
+ __nonnull ((1));
+# ifdef __REDIRECT
+extern int __REDIRECT (sigwait, (sigset_t * __set), __sigwait_sun)
+ __nonnull ((1));
+# else
+# define sigwait __sigwait_sun
+# endif
+# endif
# ifdef __USE_POSIX199309
/* Select any of pending signals from SET and place information in INFO.
_getauusernam _getexecattr vfsent fdwalk closefrom ipsecalg gethostent \
sigsendset sigsend stack_getbounds thr_sighndlrinfo sun_compat mkdev \
nss_getent nss_setent nss_endent nss_search nss_delete nss_misc \
- _nss_XbyY_fgets _getexecprof _fgetuserattr priv_str _sbrk_grow_aligned
+ _nss_XbyY_fgets _getexecprof _fgetuserattr priv_str _sbrk_grow_aligned \
+ mntent_sun
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 \
sys/ptms.h sys/stack.h sys/regset.h sys/fault.h sys/processor.h \
sys/pset.h sys/reg.h sys/siginfo.h sys/types32.h sys/isa_defs.h sys/elf.h \
sys/int_types.h sys/machelf.h sys/inttypes.h sys/atomic.h sys/machtypes.h
-sysdep_headers += procfs.h nss_common.h \
+sysdep_headers += \
rtld_db.h pcsample.h atomic.h bits/machtypes.h
headers := $(filter-out sys/sysinfo.h, $(headers))
endif
_getexecattr; getexecname; _getexecprof; getextmntent; gethrtime;
gethrvtime; __getgrent_r_sun; __getgrgid_r_sun; __getgrnam_r_sun;
getipnodebyaddr; getipnodebyname; getipsecalgbyname; getipsecalgbynum;
- getmntany; getmntent; __getopt_sun; getpagesizes; getpagesizes2;
+ getmntany; __getmntent_gnu; __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;
+ _getprofnam; getprojid; __getprotobyname_r_sun; __getprotobynumber_r_sun;
+ __getprotoent_r_sun; __getpwent_r_sun; __getpwnam_r_sun; __getpwuid_r_sun;
+ getrctl; gettaskid; _getuserattr; _getusernam; getustack; getvfsany;
+ getvfsent; getvfsfile; getvfsspec; getvmusage; getzoneid; getzoneidbyname;
+ getzonenamebyid;
# h
- hasmntopt;
+ __hasmntopt_gnu;
# i
idmap_reg; idmap_unreg; __init_daemon_priv; __init_suid_priv; _insert;
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <nss_sunP.h>
+#include <nssP.h>
#include <string.h>
void _nss_XbyY_fgets (FILE *fp, nss_XbyY_args_t *args)
--- /dev/null
+/* Structure describing state saved while handling a signal. Stub version.
+ Copyright (C) 1991, 1994, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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 _SIGNAL_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#include <sys/ucontext.h>
+
+struct sigcontext;
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <mntentP.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/ioctl.h>
-
-/* Docs: http://docs.sun.com/app/docs/doc/816-5168/resetmnttab-3c */
-
-#define _MNT_CMP(x, y, f) \
- (!y->f || (y->f && strcmp (x->f, y->f) == 0))
-
-
-int getmntent (FILE *fp, struct mnttab *mt)
-{
- struct extmnttab emt;
- int res = ioctl (fileno (fp), MNTIOC_GETMNTENT, &emt);
- if (res != 0)
- return -1;
-
- mt->mnt_special = emt.mnt_special;
- mt->mnt_mountp = emt.mnt_mountp;
- mt->mnt_fstype = emt.mnt_fstype;
- mt->mnt_mntopts = emt.mnt_mntopts;
- mt->mnt_time = emt.mnt_time;
-
- return 0;
-}
-
-int getmntany (FILE *fp, struct mnttab *mt, struct mnttab *mtpref)
-{
- int res;
- while ((res = getmntent (fp, mt)) == 0)
- {
- if (_MNT_CMP (mt, mtpref, mnt_special) &&
- _MNT_CMP (mt, mtpref, mnt_mountp) &&
- _MNT_CMP (mt, mtpref, mnt_fstype) &&
- _MNT_CMP (mt, mtpref, mnt_mntopts) &&
- _MNT_CMP (mt, mtpref, mnt_time))
- return 0;
- }
-
- return res;
-}
-
-
-int getextmntent(FILE *fp, struct extmnttab *emt, int len)
-{
- int res = ioctl (fileno (fp), MNTIOC_GETMNTENT, emt);
- if (res != 0)
- return -1;
- return 0;
-}
-
-
-char *mntopt (char **opts)
-{
- char *optsp = *opts;
-
- /* Strip leading spaces. */
- while (*optsp == ' ')
- optsp++;
-
- /* Find comma. */
- char *ret = optsp;
- while (*optsp != ',' && *optsp != '\0')
- optsp++;
-
- /* Replace comma with null terminator. */
- if (*optsp == ',')
- optsp++;
- *opts = optsp;
-
- return ret;
-}
-
-
-char *hasmntopt (struct mnttab *mt, char *opt)
-{
- /* We make a copy of mnt_mntopts since we modify it. */
- char buf[MNT_LINE_MAX + 1];
- strncpy (buf, mt->mnt_mntopts, sizeof (buf))[MNT_LINE_MAX] = '\0';
-
- char *opts = buf;
- char *optp;
- size_t len = strlen (opt);
- while (*(optp = mntopt (&opts)))
- {
- /* Check if opt matched, taking into account delimiters (e.g. '='). */
- if (strncmp (optp, opt, len) == 0 && !isalnum (optp[len]))
- return mt->mnt_mntopts + (optp - buf);
- }
-
- return NULL;
-}
-
-
-void resetmnttab (FILE *fp)
-{
- rewind (fp);
-}
+#define getmntent __getmntent_gnu
+#include <misc/mntent.c>
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Utilities for reading/writing fstab, mtab, etc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 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
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#error The glibc/linux mntent.h functions are incompatible with OpenSolaris
+#ifndef _MNTENT_H
+#define _MNTENT_H 1
+
+#include <features.h>
+#define __need_FILE
+#include <stdio.h>
+#include <paths.h>
+
+
+/* File listing canonical interesting mount points. */
+#define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
+
+/* File listing currently active mount points. */
+#define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
+
+
+/* General filesystem types. */
+#define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */
+#define MNTTYPE_NFS "nfs" /* Network file system. */
+#define MNTTYPE_SWAP "swap" /* Swap device. */
+
+
+/* Generic mount options. */
+#define MNTOPT_DEFAULTS "defaults" /* Use all default options. */
+#define MNTOPT_RO "ro" /* Read only. */
+#define MNTOPT_RW "rw" /* Read/write. */
+#define MNTOPT_SUID "suid" /* Set uid allowed. */
+#define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */
+#define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */
+
+
+__BEGIN_DECLS
+
+/* Structure describing a mount table entry. */
+struct mntent
+ {
+ char *mnt_fsname; /* Device or server for filesystem. */
+ char *mnt_dir; /* Directory mounted on. */
+ char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */
+ char *mnt_opts; /* Comma-separated options for fs. */
+ int mnt_freq; /* Dump frequency (in days). */
+ int mnt_passno; /* Pass number for `fsck'. */
+ };
+
+
+/* Prepare to begin reading and/or writing mount table entries from the
+ beginning of FILE. MODE is as for `fopen'. */
+extern FILE *setmntent (__const char *__file, __const char *__mode) __THROW;
+
+/* Read one mount table entry from STREAM. Returns a pointer to storage
+ reused on the next call, or null for EOF or error (use feof/ferror to
+ check). */
+#ifdef __REDIRECT_NTH
+extern struct mntent *__getmntent_gnu (FILE *__stream) __THROW;
+extern struct mntent * __REDIRECT_NTH (getmntent, (FILE *__stream),
+ __getmntent_gnu);
+#else
+# define getmntent __getmntent_gnu
+#endif
+
+#ifdef __USE_MISC
+/* Reentrant version of the above function. */
+extern struct mntent *getmntent_r (FILE *__restrict __stream,
+ struct mntent *__restrict __result,
+ char *__restrict __buffer,
+ int __bufsize) __THROW;
+#endif
+
+/* Close a stream opened with `setmntent'. */
+extern int endmntent (FILE *__stream) __THROW;
+
+/* Search MNT->mnt_opts for an option matching OPT.
+ Returns the address of the substring, or null if none found. */
+#ifdef __REDIRECT_NTH
+extern char *__hasmntopt_gnu (__const struct mntent *__mnt,
+ __const char *__opt) __THROW;
+extern char * __REDIRECT_NTH (hasmntopt, (__const struct mntent *__mnt,
+ __const char *__opt), __hasmntopt_gnu);
+#else
+# define hasmntopt __hasmntopt_gnu
+#endif
+
+
+__END_DECLS
+
+#endif /* mntent.h */
#ifndef _MNTENTP_H
#define _MNTENTP_H
+#include <stdio.h>
+
#define MNTIOC ('m' << 8)
#define MNTIOC_GETMNTENT (MNTIOC|7)
unsigned int mnt_minor;
};
+extern int __getmntent_sun (FILE *fp, struct mnttab *mt);
+extern char * __hasmntopt_sun (struct mnttab *mt, char *opt);
+
#endif /* _MNTENTP_H */
-/* This is here so that we don't compile the default mntent_r.c. */
+/* 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. */
+
+#define __hasmntopt ___hasmntopt_gnu
+#define hasmntopt __hasmntopt_gnu
+#include <misc/mntent_r.c>
--- /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 <mntentP.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/ioctl.h>
+
+/* Docs: http://docs.sun.com/app/docs/doc/816-5168/resetmnttab-3c */
+
+#define _MNT_CMP(x, y, f) \
+ (!y->f || (y->f && strcmp (x->f, y->f) == 0))
+
+
+int getmntent (FILE *fp, struct mnttab *mt)
+{
+ struct extmnttab emt;
+ int res = ioctl (fileno (fp), MNTIOC_GETMNTENT, &emt);
+ if (res != 0)
+ return -1;
+
+ mt->mnt_special = emt.mnt_special;
+ mt->mnt_mountp = emt.mnt_mountp;
+ mt->mnt_fstype = emt.mnt_fstype;
+ mt->mnt_mntopts = emt.mnt_mntopts;
+ mt->mnt_time = emt.mnt_time;
+
+ return 0;
+}
+
+int getmntany (FILE *fp, struct mnttab *mt, struct mnttab *mtpref)
+{
+ int res;
+ while ((res = getmntent (fp, mt)) == 0)
+ {
+ if (_MNT_CMP (mt, mtpref, mnt_special) &&
+ _MNT_CMP (mt, mtpref, mnt_mountp) &&
+ _MNT_CMP (mt, mtpref, mnt_fstype) &&
+ _MNT_CMP (mt, mtpref, mnt_mntopts) &&
+ _MNT_CMP (mt, mtpref, mnt_time))
+ return 0;
+ }
+
+ return res;
+}
+
+
+int getextmntent(FILE *fp, struct extmnttab *emt, int len)
+{
+ int res = ioctl (fileno (fp), MNTIOC_GETMNTENT, emt);
+ if (res != 0)
+ return -1;
+ return 0;
+}
+
+
+char *mntopt (char **opts)
+{
+ char *optsp = *opts;
+
+ /* Strip leading spaces. */
+ while (*optsp == ' ')
+ optsp++;
+
+ /* Find comma. */
+ char *ret = optsp;
+ while (*optsp != ',' && *optsp != '\0')
+ optsp++;
+
+ /* Replace comma with null terminator. */
+ if (*optsp == ',')
+ optsp++;
+ *opts = optsp;
+
+ return ret;
+}
+
+
+char * hasmntopt (struct mnttab *mt, char *opt)
+{
+ /* We make a copy of mnt_mntopts since we modify it. */
+ char buf[MNT_LINE_MAX + 1];
+ strncpy (buf, mt->mnt_mntopts, sizeof (buf))[MNT_LINE_MAX] = '\0';
+
+ char *opts = buf;
+ char *optp;
+ size_t len = strlen (opt);
+ while (*(optp = mntopt (&opts)))
+ {
+ /* Check if opt matched, taking into account delimiters (e.g. '='). */
+ if (strncmp (optp, opt, len) == 0 && !isalnum (optp[len]))
+ return mt->mnt_mntopts + (optp - buf);
+ }
+
+ return NULL;
+}
+
+
+void resetmnttab (FILE *fp)
+{
+ rewind (fp);
+}
--- /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 _NSSP_H
+#define _NSSP_H
+
+#include <sys/types.h>
+#include <nss/nsswitch.h>
+#include <stdint.h>
+#include <pthread.h>
+
+typedef enum
+ {
+ NSS_SUCCESS = 0,
+ NSS_NOTFOUND = 1,
+ NSS_UNAVAIL = 2,
+ NSS_TRYAGAIN = 3,
+ NSS_NISSERVDNS_TRYAGAIN = 4,
+ NSS_TRYLOCAL = 5,
+ NSS_ERROR = 6,
+ NSS_ALTRETRY = 7,
+ NSS_ALTRESET = 8,
+ NSS_NSCD_PRIV = 9
+ } nss_status_t;
+
+struct nss_backend;
+
+typedef nss_status_t (*nss_backend_op_t) (struct nss_backend *, void *);
+
+typedef struct nss_backend
+ {
+ nss_backend_op_t *ops;
+ int n_ops;
+ } nss_backend_t;
+
+typedef int nss_dbop_t;
+
+#define NSS_DBOP_DESTRUCTOR 0
+#define NSS_DBOP_ENDENT 1
+#define NSS_DBOP_SETENT 2
+#define NSS_DBOP_GETENT 3
+#define NSS_DBOP_next_iter (NSS_DBOP_GETENT + 1)
+#define NSS_DBOP_next_noiter (NSS_DBOP_DESTRUCTOR + 1)
+#define NSS_DBOP_next_ipv6_iter (NSS_DBOP_GETENT + 3)
+
+#define NSS_LOOKUP_DBOP(instp, n) \
+ (((n) >= 0 && (n) < (instp)->n_ops) ? (instp)->ops[n] : 0)
+
+#define NSS_INVOKE_DBOP(instp, n, argp) \
+ (((n) >= 0 && (n) < (instp)->n_ops && (instp)->ops[n] != 0) \
+ ? (*(instp)->ops[n])(instp, argp) : NSS_UNAVAIL)
+
+typedef nss_backend_t * (*nss_backend_constr_t) (const char *db_name,
+ const char *src_name, const char *cfg_args);
+
+typedef struct nss_backend_finder
+ {
+ nss_backend_constr_t (*lookup) (void *lkp_priv, const char *,
+ const char *, void **del_privp);
+ void (*delete) (void *del_priv, nss_backend_constr_t);
+ struct nss_backend_finder *next;
+ void *lookup_priv;
+ } nss_backend_finder_t;
+
+extern nss_backend_finder_t *nss_default_finders;
+
+enum nss_dbp_flags
+ {
+ NSS_USE_DEFAULT_CONFIG = 0x1
+ };
+
+typedef struct nss_db_params
+ {
+ const char *name;
+ const char *config_name;
+ const char *default_config;
+ unsigned max_active_per_src;
+ unsigned max_dormant_per_src;
+ enum nss_dbp_flags flags;
+ nss_backend_finder_t *finders;
+ void *private;
+ void (*cleanup) (struct nss_db_params *);
+ } nss_db_params_t;
+
+typedef void (*nss_db_initf_t) (nss_db_params_t *);
+
+typedef struct nss_dbd {
+ uint32_t o_name;
+ uint32_t o_config_name;
+ uint32_t o_default_config;
+ uint32_t flags;
+ } nss_dbd_t;
+
+struct nss_db_state;
+struct nss_getent_context;
+
+typedef struct nss_db_root
+ {
+ struct nss_db_state *s;
+ pthread_mutex_t lock;
+ } nss_db_root_t;
+
+#define NSS_DB_ROOT_INIT { 0, PTHREAD_MUTEX_INITIALIZER }
+#define DEFINE_NSS_DB_ROOT(name) nss_db_root_t name = NSS_DB_ROOT_INIT
+
+typedef struct
+ {
+ struct nss_getent_context *ctx;
+ pthread_mutex_t lock;
+ } nss_getent_t;
+
+#define NSS_GETENT_INIT { 0, PTHREAD_MUTEX_INITIALIZER }
+#define DEFINE_NSS_GETENT(name) nss_getent_t name = NSS_GETENT_INIT
+
+typedef enum
+ {
+ NSS_CONFIG_GET,
+ NSS_CONFIG_PUT,
+ NSS_CONFIG_ADD,
+ NSS_CONFIG_DELETE,
+ NSS_CONFIG_LIST
+ } nss_config_op_t;
+
+typedef struct nss_config
+ {
+ char *name;
+ nss_config_op_t cop;
+ void *lock;
+ void *buffer;
+ size_t length;
+ } nss_config_t;
+
+typedef struct
+ {
+ void *result;
+ char *buffer;
+ int buflen;
+ } nss_XbyY_buf_t;
+
+typedef int (*nss_str2ent_t)(const char *, int, void *, char *, int);
+
+typedef union nss_XbyY_key
+ {
+ uid_t uid;
+ gid_t gid;
+ projid_t projid;
+ const char *name;
+ int number;
+ struct
+ {
+ int net;
+ int type;
+ } netaddr;
+ struct
+ {
+ const char *addr;
+ int len;
+ int type;
+ } hostaddr;
+ struct
+ {
+ union
+ {
+ const char *name;
+ int port;
+ } serv;
+ const char *proto;
+ } serv;
+ void *ether;
+ struct
+ {
+ const char *name;
+ const char *keytype;
+ } pkey;
+ struct
+ {
+ const char *name;
+ int af_family;
+ int flags;
+ } ipnode;
+ void *attrp;
+} nss_XbyY_key_t;
+
+typedef int (*nss_key2str_t)(void *, size_t, nss_XbyY_key_t *, size_t *);
+
+typedef struct nss_XbyY_args
+ {
+ nss_XbyY_buf_t buf;
+ int stayopen;
+ nss_str2ent_t str2ent;
+ union nss_XbyY_key key;
+ void *returnval;
+ int erange;
+ int h_errno;
+ nss_status_t status;
+ nss_key2str_t key2str;
+ size_t returnlen;
+ } nss_XbyY_args_t;
+
+struct nss_getent_context
+ {
+ char getfuncname[30];
+ char setfuncname[30];
+ char endfuncname[30];
+ db_lookup_function dblookupfunc;
+
+ service_user *nip;
+ service_user *last_nip;
+ service_user *startp;
+
+ int stayopen;
+ int stayopen_tmp;
+ };
+
+#define NSS_STR_PARSE_SUCCESS 0
+#define NSS_STR_PARSE_PARSE 1
+#define NSS_STR_PARSE_ERANGE 2
+
+typedef enum nss_status (*lookup_function) (void *, char *, size_t, int *);
+
+struct nss_db_state
+ {
+ bool startp_initialized;
+ service_user *startp;
+ lookup_function start_fct;
+
+ db_lookup_function dblookupfunc;
+ const char **dbtable;
+ };
+
+#define RESULT_TO_STATUS(res) \
+ ((res == 0) ? NSS_SUCCESS : (res == ENOENT) ? NSS_TRYAGAIN : NSS_ERROR)
+
+enum nss_dbid
+ {
+ NSS_DBID_AUTH_ATTR,
+ NSS_DBID_AUTOMOUNT,
+ NSS_DBID_BOOTPARAMS,
+ NSS_DBID_NETMASKS,
+ NSS_DBID_PRINTERS,
+ NSS_DBID_PROF_ATTR,
+ NSS_DBID_PROJECT,
+ _NSS_DBID_MAX = NSS_DBID_PROJECT
+ };
+
+#define _NSS_DBENTRY_MAX 6
+
+extern int __nss_get_dbid (const char *dbname);
+extern const char ** __nss_get_dbtable (int dbid);
+extern db_lookup_function __nss_get_dblookupfunc (int dbid);
+
+
+#endif /* _NSSP_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. */
-
-#ifndef _NSS_COMMON_H
-#define _NSS_COMMON_H
-
-#include <sys/types.h>
-#include <stdint.h>
-#include <pthread.h>
-
-typedef enum
- {
- NSS_SUCCESS = 0,
- NSS_NOTFOUND = 1,
- NSS_UNAVAIL = 2,
- NSS_TRYAGAIN = 3,
- NSS_NISSERVDNS_TRYAGAIN = 4,
- NSS_TRYLOCAL = 5,
- NSS_ERROR = 6,
- NSS_ALTRETRY = 7,
- NSS_ALTRESET = 8,
- NSS_NSCD_PRIV = 9
- } nss_status_t;
-
-struct nss_backend;
-
-typedef nss_status_t (*nss_backend_op_t) (struct nss_backend *, void *);
-
-typedef struct nss_backend
- {
- nss_backend_op_t *ops;
- int n_ops;
- } nss_backend_t;
-
-typedef int nss_dbop_t;
-
-#define NSS_DBOP_DESTRUCTOR 0
-#define NSS_DBOP_ENDENT 1
-#define NSS_DBOP_SETENT 2
-#define NSS_DBOP_GETENT 3
-#define NSS_DBOP_next_iter (NSS_DBOP_GETENT + 1)
-#define NSS_DBOP_next_noiter (NSS_DBOP_DESTRUCTOR + 1)
-#define NSS_DBOP_next_ipv6_iter (NSS_DBOP_GETENT + 3)
-
-#define NSS_LOOKUP_DBOP(instp, n) \
- (((n) >= 0 && (n) < (instp)->n_ops) ? (instp)->ops[n] : 0)
-
-#define NSS_INVOKE_DBOP(instp, n, argp) \
- (((n) >= 0 && (n) < (instp)->n_ops && (instp)->ops[n] != 0) \
- ? (*(instp)->ops[n])(instp, argp) : NSS_UNAVAIL)
-
-typedef nss_backend_t * (*nss_backend_constr_t) (const char *db_name,
- const char *src_name, const char *cfg_args);
-
-typedef struct nss_backend_finder
- {
- nss_backend_constr_t (*lookup) (void *lkp_priv, const char *,
- const char *, void **del_privp);
- void (*delete) (void *del_priv, nss_backend_constr_t);
- struct nss_backend_finder *next;
- void *lookup_priv;
- } nss_backend_finder_t;
-
-extern nss_backend_finder_t *nss_default_finders;
-
-enum nss_dbp_flags
- {
- NSS_USE_DEFAULT_CONFIG = 0x1
- };
-
-typedef struct nss_db_params
- {
- const char *name;
- const char *config_name;
- const char *default_config;
- unsigned max_active_per_src;
- unsigned max_dormant_per_src;
- enum nss_dbp_flags flags;
- nss_backend_finder_t *finders;
- void *private;
- void (*cleanup) (struct nss_db_params *);
- } nss_db_params_t;
-
-typedef void (*nss_db_initf_t) (nss_db_params_t *);
-
-typedef struct nss_dbd {
- uint32_t o_name;
- uint32_t o_config_name;
- uint32_t o_default_config;
- uint32_t flags;
- } nss_dbd_t;
-
-struct nss_db_state;
-struct nss_getent_context;
-
-typedef struct nss_db_root
- {
- struct nss_db_state *s;
- pthread_mutex_t lock;
- } nss_db_root_t;
-
-#define NSS_DB_ROOT_INIT { 0, PTHREAD_MUTEX_INITIALIZER }
-#define DEFINE_NSS_DB_ROOT(name) nss_db_root_t name = NSS_DB_ROOT_INIT
-
-typedef struct
- {
- struct nss_getent_context *ctx;
- pthread_mutex_t lock;
- } nss_getent_t;
-
-#define NSS_GETENT_INIT { 0, PTHREAD_MUTEX_INITIALIZER }
-#define DEFINE_NSS_GETENT(name) nss_getent_t name = NSS_GETENT_INIT
-
-typedef enum
- {
- NSS_CONFIG_GET,
- NSS_CONFIG_PUT,
- NSS_CONFIG_ADD,
- NSS_CONFIG_DELETE,
- NSS_CONFIG_LIST
- } nss_config_op_t;
-
-typedef struct nss_config
- {
- char *name;
- nss_config_op_t cop;
- void *lock;
- void *buffer;
- size_t length;
- } nss_config_t;
-
-__BEGIN_DECLS
-
-extern nss_status_t nss_config (nss_config_t **, int);
-
-extern nss_status_t nss_search (nss_db_root_t *, nss_db_initf_t,
- int search_fnum, void *search_args);
-extern nss_status_t nss_getent (nss_db_root_t *, nss_db_initf_t,
- nss_getent_t *, void *getent_args);
-extern void nss_setent (nss_db_root_t *, nss_db_initf_t, nss_getent_t *);
-extern void nss_endent (nss_db_root_t *, nss_db_initf_t, nss_getent_t *);
-extern void nss_delete (nss_db_root_t *);
-
-extern nss_status_t nss_pack (void *, size_t, nss_db_root_t *,
- nss_db_initf_t, int, void *);
-extern nss_status_t nss_pack_ent (void *, size_t, nss_db_root_t *,
- nss_db_initf_t, nss_getent_t *);
-extern nss_status_t nss_unpack (void *, size_t, nss_db_root_t *,
- nss_db_initf_t, int, void *);
-extern nss_status_t nss_unpack_ent (void *, size_t, nss_db_root_t *,
- nss_db_initf_t, nss_getent_t *, void *);
-
-extern nss_status_t _nsc_search (nss_db_root_t *, nss_db_initf_t,
- int search_fnum, void *search_args);
-extern nss_status_t _nsc_getent_u (nss_db_root_t *, nss_db_initf_t,
- nss_getent_t *, void *getent_args);
-extern nss_status_t _nsc_setent_u (nss_db_root_t *, nss_db_initf_t,
- nss_getent_t *);
-extern nss_status_t _nsc_endent_u(nss_db_root_t *, nss_db_initf_t,
- nss_getent_t *);
-
-__END_DECLS
-
-#endif /* _NSS_COMMON_H */
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <nss_sunP.h>
+#include <nssP.h>
#include <string.h>
#include <pthread.h>
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <nss_sunP.h>
+#include <nssP.h>
#include <string.h>
#include <pthread.h>
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <nss_sunP.h>
+#include <nssP.h>
#include <string.h>
#include <bits/libc-lock.h>
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <nss_sunP.h>
+#include <nssP.h>
#include <string.h>
int __nss_get_dbid (const char *dbname)
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <nss_sunP.h>
+#include <nssP.h>
#include <string.h>
#include <bits/libc-lock.h>
#include <atomic.h>
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <nss_sunP.h>
+#include <nssP.h>
#include <string.h>
#include <bits/libc-lock.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. */
-
-#ifndef _NSS_SUNP_H
-#define _NSS_SUNP_H
-
-#include <sys/types.h>
-#include <nss/nsswitch.h>
-#include "nss_common.h"
-
-typedef struct
- {
- void *result;
- char *buffer;
- int buflen;
- } nss_XbyY_buf_t;
-
-typedef int (*nss_str2ent_t)(const char *, int, void *, char *, int);
-
-typedef union nss_XbyY_key
- {
- uid_t uid;
- gid_t gid;
- projid_t projid;
- const char *name;
- int number;
- struct
- {
- int net;
- int type;
- } netaddr;
- struct
- {
- const char *addr;
- int len;
- int type;
- } hostaddr;
- struct
- {
- union
- {
- const char *name;
- int port;
- } serv;
- const char *proto;
- } serv;
- void *ether;
- struct
- {
- const char *name;
- const char *keytype;
- } pkey;
- struct
- {
- const char *name;
- int af_family;
- int flags;
- } ipnode;
- void *attrp;
-} nss_XbyY_key_t;
-
-typedef int (*nss_key2str_t)(void *, size_t, nss_XbyY_key_t *, size_t *);
-
-typedef struct nss_XbyY_args
- {
- nss_XbyY_buf_t buf;
- int stayopen;
- nss_str2ent_t str2ent;
- union nss_XbyY_key key;
- void *returnval;
- int erange;
- int h_errno;
- nss_status_t status;
- nss_key2str_t key2str;
- size_t returnlen;
- } nss_XbyY_args_t;
-
-struct nss_getent_context
- {
- char getfuncname[30];
- char setfuncname[30];
- char endfuncname[30];
- db_lookup_function dblookupfunc;
-
- service_user *nip;
- service_user *last_nip;
- service_user *startp;
-
- int stayopen;
- int stayopen_tmp;
- };
-
-#define NSS_STR_PARSE_SUCCESS 0
-#define NSS_STR_PARSE_PARSE 1
-#define NSS_STR_PARSE_ERANGE 2
-
-typedef enum nss_status (*lookup_function) (void *, char *, size_t, int *);
-
-struct nss_db_state
- {
- bool startp_initialized;
- service_user *startp;
- lookup_function start_fct;
-
- db_lookup_function dblookupfunc;
- const char **dbtable;
- };
-
-#define RESULT_TO_STATUS(res) \
- ((res == 0) ? NSS_SUCCESS : (res == ENOENT) ? NSS_TRYAGAIN : NSS_ERROR)
-
-enum nss_dbid
- {
- NSS_DBID_AUTH_ATTR,
- NSS_DBID_AUTOMOUNT,
- NSS_DBID_BOOTPARAMS,
- NSS_DBID_NETMASKS,
- NSS_DBID_PRINTERS,
- NSS_DBID_PROF_ATTR,
- NSS_DBID_PROJECT,
- _NSS_DBID_MAX = NSS_DBID_PROJECT
- };
-
-#define _NSS_DBENTRY_MAX 6
-
-extern int __nss_get_dbid (const char *dbname);
-extern const char ** __nss_get_dbtable (int dbid);
-extern db_lookup_function __nss_get_dblookupfunc (int dbid);
-
-#endif /* _NSS_SUNP_H */
+++ /dev/null
-/* Include file for getting new procfs API
- Copyright (C) 2008 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 _PROCFS_H
-#define _PROCFS_H
-
-#ifdef _STRUCTURED_PROC
-# undef _STRUCTURED_PROC
-#endif
-#define _STRUCTURED_PROC 1
-
-#include <sys/procfs.h>
-
-#endif /* _PROCFS_H */
{
return sigtimedwait (set, NULL, NULL);
}
+
+
+struct protoent * __getprotoent_r_sun ()
+{
+}
+
+
+struct protoent * __getprotobyname_r_sun ()
+{
+}
+
+
+struct protoent * __getprotobynumber_r_sun ()
+{
+}
-/* This file is intentionally blank. */
+/* This file is intended to be a stub, to be replaced by the official
+ OpenSolaris version. */
+++ /dev/null
-/* Structure describing state saved while handling a signal. Stub version.
- Copyright (C) 1991, 1994, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 _SIGNAL_H
-# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
-#endif
-
-/* 'struct sigcontext' is only ever used by sigreturn, which we don't have. */
-struct sigcontext;