From owner-freebsd-current Mon Nov 11 7: 3:43 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83E3D37B401 for ; Mon, 11 Nov 2002 07:03:39 -0800 (PST) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D57343E3B for ; Mon, 11 Nov 2002 07:03:39 -0800 (PST) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 652699BC3; Mon, 11 Nov 2002 09:54:58 -0500 (EST) Date: Mon, 11 Nov 2002 09:54:58 -0500 From: Mike Barcroft To: Marc Recht Cc: Garrett Wollman , current@freebsd.org Subject: Re: addition to cdefs Message-ID: <20021111095458.F52940@espresso.q9media.com> References: <1037017897.779.20.camel@leeloo.intern.geht.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline In-Reply-To: <1037017897.779.20.camel@leeloo.intern.geht.de>; from marc@informatik.uni-bremen.de on Mon, Nov 11, 2002 at 01:31:36PM +0100 Organization: The FreeBSD Project Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Marc Recht writes: > Hi! > > I've made a small patch to make it possible to enable BSD extensions > although _POSIX_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE has been > defined. This is made with a new define _BSD_SOURCE right after the > XOPEN_SOURCE handling. It sets __XSI_VISIBLE 600 and __BSD_VISIBLE 1. > This is needed for some programs. For example for Python 2.3cvs sets > (among others) _POSIX_C_SOURCE 199506L, but also expects to have chroot > and friends. It looks like has some XSI bugs. Is _XOPEN_SOURCE defined anywhere? If so, try the attached patch. If not, this is a bug in Python (since POSIX doesn't specify chroot()) and should be fixed at their end and in the ports collection. _BSD_SOURCE provides mostly the same visibility as not defining any standards constants, so it isn't very useful. Best regards, Mike Barcroft --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="unistd.diff" Index: unistd.h =================================================================== RCS file: /work/repo/src/include/unistd.h,v retrieving revision 1.63 diff -u -r1.63 unistd.h --- unistd.h 28 Oct 2002 00:15:43 -0000 1.63 +++ unistd.h 11 Nov 2002 14:48:50 -0000 @@ -361,7 +361,7 @@ ssize_t write(int, const void *, size_t); /* 1003.2-1992 */ -#if __POSIX_VISIBLE >= 199209 +#if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE size_t confstr(int, char *, size_t); int getopt(int, char * const [], const char *); @@ -370,7 +370,7 @@ #endif /* ISO/IEC 9945-1: 1996 */ -#if __POSIX_VISIBLE >= 199506 +#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE int fsync(int); /* @@ -381,13 +381,18 @@ #define _FTRUNCATE_DECLARED int ftruncate(int, off_t); #endif +#endif +#if __POSIX_VISIBLE >= 199506 int getlogin_r(char *, int); #endif /* 1003.1-2001 */ -#if __POSIX_VISIBLE >= 200112 +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE int fchown(int, uid_t, gid_t); +int readlink(const char *, char *, int); +#endif +#if __POSIX_VISIBLE >= 200112 int gethostname(char *, int /* socklen_t */); int setegid(gid_t); int seteuid(uid_t); @@ -408,6 +413,7 @@ /* char *ctermid(char *); */ /* XXX ??? */ int encrypt(char *, int); int fchdir(int); +long gethostid(void); int getpgid(pid_t _pid); int getsid(pid_t _pid); char *getwd(char *); /* LEGACY: obsoleted by getcwd() */ @@ -432,13 +438,20 @@ #endif #endif /* __XSI_VISIBLE */ +#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE +int brk(const void *); +int chroot(const char *); +int getdtablesize(void); +int getpagesize(void) __pure2; +char *getpass(const char *); +void *sbrk(intptr_t); +#endif + #if __BSD_VISIBLE struct timeval; /* select(2) */ int acct(const char *); int async_daemon(void); -int brk(const void *); int check_utility_compat(const char *); -int chroot(const char *); const char * crypt_get_format(void); int crypt_set_format(const char *); @@ -448,12 +461,8 @@ int exect(const char *, char * const *, char * const *); char *fflagstostr(u_long); int getdomainname(char *, int); -int getdtablesize(void); int getgrouplist(const char *, gid_t, gid_t *, int *); -long gethostid(void); mode_t getmode(const void *, mode_t); -int getpagesize(void) __pure2; -char *getpass(const char *); int getpeereid(int, uid_t *, gid_t *); int getresgid(gid_t *, gid_t *, gid_t *); int getresuid(uid_t *, uid_t *, uid_t *); @@ -483,7 +492,6 @@ const char *, const char *, const char *); char *re_comp(const char *); int re_exec(const char *); -int readlink(const char *, char *, int); int reboot(int); int revoke(const char *); pid_t rfork(int); @@ -491,7 +499,6 @@ int rresvport(int *); int rresvport_af(int *, int); int ruserok(const char *, int, const char *, const char *); -void *sbrk(intptr_t); #if __BSD_VISIBLE #ifndef _SELECT_DECLARED #define _SELECT_DECLARED --1LKvkjL3sHcu1TtY-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message