or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
-# ifdef __USE_MISC
-# ifndef __USE_SUN
+# ifdef __USE_GNU
extern int getgrent_r (struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result);
-# else
-extern struct group * __getgrent_r_sun (struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen);
-# ifdef __REDIRECT
-extern struct group * __REDIRECT (getgrent_r, (
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen), __getgrent_r_sun);
-# else
-# define getgrent_r __getgrent_r_sun
-# endif
-# endif
# endif
/* Search for an entry with a matching group ID.
This function is a possible cancellation point and therefore not
marked with __THROW. */
-# ifndef __USE_SUN
extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result);
-# else
-extern struct group * __getgrgid_r_sun (__gid_t __gid,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen);
-# ifdef __REDIRECT
-extern struct group * __REDIRECT (getgrgid_r, (__gid_t __gid,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen), __getgrgid_r_sun);
-# else
-# define getgrgid_r __getgrgid_r_sun
-# endif
-# endif
/* Search for an entry with a matching group name.
This function is a possible cancellation point and therefore not
marked with __THROW. */
-# ifndef __USE_SUN
extern int getgrnam_r (__const char *__restrict __name,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result);
-# else
-extern struct group * __getgrnam_r_sun (__const char *__restrict __name,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen);
-# ifdef __REDIRECT
-extern struct group * __REDIRECT (getgrnam_r, (__const char *__restrict __name,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen), __getgrnam_r_sun);
-# else
-# define getgrnam_r __getgrnam_r_sun
-# endif
-# endif
# ifdef __USE_SVID
/* Read a group entry from STREAM. This function is not standardized
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 __USE_SUN
extern int fgetgrent_r (FILE *__restrict __stream,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result);
-# else
-extern struct group * __fgetgrent_r_sun (FILE *__restrict __stream,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen);
-# ifdef __REDIRECT
-extern struct group * __REDIRECT (fgetgrent_r, (FILE *__restrict __stream,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen), __fgetgrent_r_sun);
-# else
-# define fgetgrent_r __fgetgrent_r_sun
-# endif
-# endif
# endif
#endif /* POSIX or reentrant */
_SVID_SOURCE ISO C, POSIX, and SVID things.
_ATFILE_SOURCE Additional *at interfaces.
_GNU_SOURCE All of the above, plus GNU extensions.
- _SUN_SOURCE Defines things that Sun expects.
_REENTRANT Select additionally reentrant object.
_THREAD_SAFE Same as _REENTRANT, often used by other systems.
_FORTIFY_SOURCE If set to numeric value > 0 additional security
#undef __USE_MISC
#undef __USE_ATFILE
#undef __USE_GNU
-#undef __USE_SUN
#undef __USE_REENTRANT
#undef __USE_FORTIFY_LEVEL
#undef __FAVOR_BSD
#if defined _BSD_SOURCE && \
!(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
- defined _GNU_SOURCE || defined _SVID_SOURCE || _SUN_SOURCE)
+ defined _GNU_SOURCE || defined _SVID_SOURCE)
# define __FAVOR_BSD 1
#endif
-#if !defined(_SUN_SOURCE) && !defined(_POSIX_C_SOURCE)
-# define _POSIX_C_SOURCE 1
-#endif
-
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
#ifdef _GNU_SOURCE
# undef _ISOC99_SOURCE
# define _ATFILE_SOURCE 1
#endif
-/* If _SUN_SOURCE was defined by the user we enable Sun compatibility mode. */
-#if defined (_SUN_SOURCE) && !defined (_POSIX_PTHREAD_SEMANTICS)
-# undef __USE_SUN
-# define __USE_SUN 1
-# undef _BSD_SOURCE
-# define _BSD_SOURCE 1
-# undef _SVID_SOURCE
-# define _SVID_SOURCE 1
-# undef _ATFILE_SOURCE
-# define _ATFILE_SOURCE 1
-# ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 1
-# endif
-#endif
-
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
arguments to the option '\0'. This behavior is specific to the GNU
`getopt'. */
-#ifndef __SUN_COMPAT_MODE
-# ifdef __GNU_LIBRARY__
+#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
-#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 */
+#endif /* __GNU_LIBRARY__ */
#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 __USE_SUN
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 __USE_SUN
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 __USE_SUN
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 __USE_SUN
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 */
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.
GLIBC_2.6 {
strerror_l;
}
- GLIBC_2.7 {
- strlcat; strlcpy;
- }
}
extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
size_t __n) __THROW __nonnull ((1, 2));
-extern size_t strlcat (char *__restrict __dest, __const char *__restrict __src,
- size_t __n) __THROW __nonnull ((1, 2));
-extern size_t strlcpy (char *__restrict __dest, __const char *__restrict __src,
- size_t __n) __THROW __nonnull ((1, 2));
-
/* Compare S1 and S2. */
extern int strcmp (__const char *__s1, __const char *__s2)
__THROW __attribute_pure__ __nonnull ((1, 2));
+++ /dev/null
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
-size_t
-strlcat (char *dst, const char *src, size_t siz)
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
- size_t dlen;
-
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (n-- != 0 && *d != '\0')
- d++;
- dlen = d - dst;
- n = siz - dlen;
-
- if (n == 0)
- return(dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
- n--;
- }
- s++;
- }
- *d = '\0';
-
- return(dlen + (s - src)); /* count does not include NUL */
-}
+++ /dev/null
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-strlcpy (char *dst, const char *src, size_t siz)
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
- ;
- }
-
- return(s - src - 1); /* count does not include NUL */
-}
is_system_labeled privP modctl acl facl lltostr ulltostr _getauthnam \
_getauthattr deflt _getprofnam _getprofattr _getusernam _getuserattr \
_getauuserent _getauusernam _getexecattr vfsent fdwalk closefrom ipsecalg \
- gethostent sigsendset sigsend stack_getbounds thr_sighndlrinfo sun_compat \
+ gethostent sigsendset sigsend stack_getbounds thr_sighndlrinfo \
mkdev nss_getent nss_setent nss_endent nss_search nss_delete nss_misc \
_nss_XbyY_fgets _getexecprof _fgetuserattr priv_str _sbrk_grow_aligned \
- mntent_sun cftime ascftime inet_ntoa_r
+ cftime ascftime inet_ntoa_r
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/ptyvar.h sys/synch.h sys/fork.h sys/sockio.h sys/ioccom.h sys/tty.h \
sys/trap.h sys/sysconfig.h sys/ptms.h sys/stack.h sys/regset.h sys/fault.h \
sys/reg.h sys/siginfo.h sys/types32.h sys/isa_defs.h sys/int_types.h \
- sys/inttypes.h sys/atomic.h sys/machtypes.h sys/elf.h sys/mnttab.h
+ sys/inttypes.h sys/atomic.h sys/machtypes.h sys/elf.h
sysdep_headers += rtld_db.h pcsample.h atomic.h bits/machtypes.h
headers := $(filter-out sys/sysinfo.h sys/swap.h, $(headers))
endif
_endauuser; _endauthattr; _endexecattr; _endprofattr; _enduserattr;
# f
- facl; fdwalk; __fgetgrent_r_sun; __fgetpwent_r_sun; _fgetuserattr;
- __fini_daemon_priv; fork1; freehostent; freeipsecalgent;
+ facl; fdwalk; _fgetuserattr; __fini_daemon_priv; fork1; freehostent;
+ freeipsecalgent;
# g
getacct; _getauuserent; _getauusernam; _getauthattr; _getauthnam; getcpuid;
_getexecattr; getexecname; _getexecprof; getextmntent; gethrtime;
- gethrvtime; __getgrent_r_sun; __getgrgid_r_sun; __getgrnam_r_sun;
- getipnodebyaddr; getipnodebyname; getipsecalgbyname; getipsecalgbynum;
- getmntany; __getmntent_sun; __getopt_sun; getpagesizes; getpagesizes2;
- getpeerucred; getpflags; getppriv; getprivimplinfo; _getprofattr;
- _getprofnam; getprojid; __getprotobyname_r_sun; __getprotobynumber_r_sun;
- __getprotoent_r_sun; __getpwent_r_sun; __getpwnam_r_sun; __getpwuid_r_sun;
- getrctl; __getrpcbyname_r_sun; __getrpcbynumber_r_sun; __getrpcent_r_sun;
- __getservbyname_r_sun; __getservbyport_r_sun; __getservent_r_sun; gettaskid;
- _getuserattr; _getusernam; getustack; getvfsany; getvfsent; getvfsfile;
- getvfsspec; getvmusage; getzoneid; getzoneidbyname; getzonenamebyid;
-
- # h
- __hasmntopt_sun;
+ gethrvtime; getipnodebyaddr; getipnodebyname; getipsecalgbyname;
+ getipsecalgbynum; getmntany; getpagesizes; getpagesizes2; getpeerucred;
+ getpflags; getppriv; getprivimplinfo; _getprofattr; _getprofnam; getprojid;
+ getrctl; gettaskid; _getuserattr; _getusernam; getustack; getvfsany;
+ getvfsent; getvfsfile; getvfsspec; getvmusage; getzoneid; getzoneidbyname;
+ getzonenamebyid;
# i
idmap_reg; idmap_unreg; inet_ntoa_r; __init_daemon_priv; __init_suid_priv;
_sbrk_grow_aligned; sendfilev; sendfilev64; _setauuser; _setauthattr;
_setexecattr; setpflags; setppriv; _setprofattr; setprojrctl; setrctl;
settaskid; _setuserattr; setustack; sig2str; _sigoff; _sigon; sigsend;
- sigsendset; __sigwait_sun; _so_accept; _so_bind; _so_connect;
- _so_getpeername; _so_getsockname; _so_getsockopt; _so_listen; _so_recv;
- _so_recvfrom; _so_recvmsg; _so_send; _so_sendmsg; _so_sendto;
- _so_setsockopt; _so_shutdown; _so_socket; _so_socketpair; stack_getbounds;
- str2sig; strlcat; strlcpy; swapctl; _sysconf; __systemcall; sysfs;
- systeminfo;
+ sigsendset; _so_accept; _so_bind; _so_connect; _so_getpeername;
+ _so_getsockname; _so_getsockopt; _so_listen; _so_recv; _so_recvfrom;
+ _so_recvmsg; _so_send; _so_sendmsg; _so_sendto; _so_setsockopt;
+ _so_shutdown; _so_socket; _so_socketpair; stack_getbounds; str2sig;
+ swapctl; _sysconf; __systemcall; sysfs; systeminfo;
# t
thr_sighndlrinfo; _ttyname_dev;
+++ /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 _MNTENTP_H
-#define _MNTENTP_H
-
-#include <stdio.h>
-
-#define MNTIOC ('m' << 8)
-#define MNTIOC_GETMNTENT (MNTIOC|7)
-
-struct mnttab;
-extern int __getmntent_sun (FILE *fp, struct mnttab *mt);
-extern char * __hasmntopt_sun (struct mnttab *mt, char *opt);
-
-#endif /* _MNTENTP_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 <mntentP.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/ioctl.h>
-#define __USE_SUN
-#include <sys/mnttab.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_sun (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, size_t 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_sun (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. */
-
-#include <pwd.h>
-#include <grp.h>
-#include <unistd.h>
-#include <alloca.h>
-#include <stdlib.h>
-#include <string.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;
-}
-
-
-struct group * __getgrnam_r_sun (const char *name, struct group *gbuf,
- char *buf, size_t buflen)
-{
- struct group *bufp;
- return (getgrnam_r (name, gbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
-}
-
-
-struct group * __getgrgid_r_sun (gid_t gid, struct group *gbuf, char *buf,
- size_t buflen)
-{
- struct group *bufp;
- return (getgrgid_r (gid, gbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
-}
-
-
-struct group * __getgrent_r_sun (struct group *gbuf, char *buf, size_t buflen)
-{
- struct group *bufp;
- return (getgrent_r (gbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
-}
-
-
-struct group * __fgetgrent_r_sun (FILE *fp, struct group *gbuf, char *buf,
- size_t buflen)
-{
- struct group *bufp;
- return (fgetgrent_r (fp, gbuf, buf, buflen, &bufp) == 0) ? bufp : NULL;
-}
-
-
-int __getopt_sun (int argc, char * const argv[], const char *optstring)
-{
- size_t len = strlen (optstring) + 2;
- int use_alloca = __libc_use_alloca (len);
- char *optstr;
- if (use_alloca)
- optstr = alloca (len);
- else
- {
- optstr = malloc (len);
- if (!optstr)
- return -1;
- }
-
- optstr[0] = '+';
- memcpy (optstr + 1, optstring, len - 1);
-
- int res = getopt (argc, argv, optstr);
-
- if (!use_alloca)
- free (optstr);
-
- return res;
-}
-
-
-int __sigwait_sun (sigset_t * set)
-{
- return sigtimedwait (set, NULL, NULL);
-}
-
-
-struct protoent * __getprotoent_r_sun (struct protoent *result, char *buf,
- size_t buflen)
-{
- struct protoent *bufp;
- return (getprotoent_r (result, buf, buflen, &bufp) == 0) ? bufp : NULL;
-}
-
-
-struct protoent * __getprotobyname_r_sun (const char *name,
- struct protoent *result, char *buf, size_t buflen)
-{
- struct protoent *bufp;
- return (getprotobyname_r (name, result, buf, buflen, &bufp) == 0)
- ? bufp : NULL;
-}
-
-
-struct protoent * __getprotobynumber_r_sun (int proto, struct protoent *result,
- char *buf, size_t buflen)
-{
- struct protoent *bufp;
- return (getprotobynumber_r (proto, result, buf, buflen, &bufp) == 0)
- ? bufp : NULL;
-}
-
-
-struct servent * __getservent_r_sun (struct servent *result, char *buf,
- size_t buflen)
-{
- struct servent *bufp;
- return (getservent_r (result, buf, buflen, &bufp) == 0) ? bufp : NULL;
-}
-
-
-struct servent * __getservbyname_r_sun (const char * name, const char *proto,
- struct servent *result, char *buf, size_t buflen)
-{
- struct servent *bufp;
- return (getservbyname_r (name, proto, result, buf, buflen, &bufp) == 0)
- ? bufp : NULL;
-}
-
-
-struct servent * __getservbyport_r_sun (int port, const char *proto,
- struct servent *result, char *buf, size_t buflen)
-{
- struct servent *bufp;
- return (getservbyport_r (port, proto, result, buf, buflen, &bufp) == 0)
- ? bufp : NULL;
-}
-
-
-struct rpcent * __getrpcbyname_r_sun (const char *name, struct rpcent *result,
- char *buf, size_t buflen)
-{
- struct rpcent *bufp;
- return (getrpcbyname_r (name, result, buf, buflen, &bufp) == 0)
- ? bufp : NULL;
-}
-
-
-struct rpcent * __getrpcbynumber_r_sun (int number, struct rpcent *result,
- char *buf, size_t buflen)
-{
- struct rpcent *bufp;
- return (getservbyport_r (number, result, buf, buflen, &bufp) == 0)
- ? bufp : NULL;
-}
-
-
-struct rpcent * __getrpcent_r_sun (struct rpcent *result, char *buf,
- size_t buflen)
-{
- struct rpcent *bufp;
- return (getrpcent_r (result, buf, buflen, &bufp) == 0) ? bufp : NULL;
-}
+++ /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 _SYS_MNTTAB_H
-#define _SYS_MNTTAB_H
-
-#include <features.h>
-#include <paths.h>
-
-#ifndef __USE_SUN
-# include <mntent.h>
-#else
-
-# define MNTTAB _PATH_MOUNTED
-# define MNT_LINE_MAX 1024
-
-# define MNT_TOOLONG 1
-# define MNT_TOOMANY 2
-# define MNT_TOOFEW 3
-
-# define mntnull(mp) ((mp)->mnt_special = (mp)->mnt_mountp = \
- (mp)->mnt_fstype = (mp)->mnt_mntopts = (mp)->mnt_time = NULL)
-# define putmntent(fd, mp) (-1)
-
-struct mnttab
- {
- char *mnt_special;
- char *mnt_mountp;
- char *mnt_fstype;
- char *mnt_mntopts;
- char *mnt_time;
- };
-
-/*
- * NOTE: fields in extmnttab should match struct mnttab till new fields
- * are encountered, this allows hasmntopt to work properly when its arg is
- * a pointer to an extmnttab struct cast to a mnttab struct pointer.
- */
-struct extmnttab
- {
- char *mnt_special;
- char *mnt_mountp;
- char *mnt_fstype;
- char *mnt_mntopts;
- char *mnt_time;
- unsigned int mnt_major;
- unsigned int mnt_minor;
- };
-
-__BEGIN_DECLS
-
-extern void resetmnttab (FILE *);
-# ifdef __REDIRECT_NTH
-extern int __getmntent_sun (FILE *, struct mnttab *);
-extern int __REDIRECT_NTH (getmntent, (FILE *, struct mnttab *),
- __getmntent_sun);
-# else
-# define getmntent __getmntent_sun
-# endif
-extern int getextmntent (FILE *, struct extmnttab *, size_t);
-extern int getmntany (FILE *, struct mnttab *, struct mnttab *);
-# ifdef __REDIRECT_NTH
-extern char * __hasmntopt_sun (struct mnttab *, char *);
-extern char * __REDIRECT_NTH (hasmntopt, (struct mnttab *, char *),
- __hasmntopt_sun);
-# else
-# define hasmntopt __hasmntopt_sun
-# endif
-extern char *mntopt (char **);
-
-__END_DECLS
-
-#endif /* __USE_SUN */
-
-#endif /* _SYS_MNTTAB_H */