This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Declare getpagesize as int


I don't think this is a problem. They won't get used. For regular
mallocr.c, malloc_getpagesize is defined by that point so the BSD stuff doesn't get used under #ifdnef malloc_getpagesize. For the linux version, the sysconf check will pass and will be used.


-- Jeff J.

On 18/09/09 05:52 PM, Howland Craig D (Craig) wrote:
What about stdlib/mallocr.c and sys/linux/malloc.c?  They can use it
under some conditions, and have their own prototype with size_t that
would conflict with a changed unistd.h.  That is, compile errors could
possibly occur.  (There are lots of ifdefs, so it's hard to tell when
the problem might surface or remain latent.)  If unistd.h is changed,
these probably need to be, too.

Craig

-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
On Behalf Of Christopher Faylor
Sent: Friday, September 18, 2009 4:30 PM
To: newlib@sourceware.org
Subject: [RFA] Declare getpagesize as int

Any objections to this change?

It was motivated by: http://cygwin.com/ml/cygwin/2009-09/msg00449.html

cgf

2009-09-18 Christopher Faylor<me+cygwin@cgf.cx>

         * libc/include/sys/unistd.h: Declare getpagesize as returning
         POSIX-mandated int.

Index: libc/include/sys/unistd.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.68
diff -d -u -r1.68 unistd.h
--- libc/include/sys/unistd.h	16 Oct 2008 23:03:40 -0000	1.68
+++ libc/include/sys/unistd.h	18 Sep 2009 20:29:18 -0000
@@ -81,7 +81,7 @@
  int _EXFUN(getlogin_r, (char *name, size_t namesize) );
  #endif
  char 	_EXFUN(*getpass, (const char *__prompt));
-size_t  _EXFUN(getpagesize, (void));
+int	_EXFUN(getpagesize, (void));
  #if defined(__CYGWIN__)
  int    _EXFUN(getpeereid, (int, uid_t *, gid_t *));
  #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]