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: New contributor o/ hello, and small diff.


The formatted patch is attached.
Thanks.

On Mon, Jun 26, 2017 at 12:41 PM, Luca Barbato <lu_zero@gentoo.org> wrote:
> On 6/26/17 8:45 PM, Dionna Amalie Glaze via newlib wrote:
>> Hi y'all! Thank you so much for your work on newlib. It's a fantastic
>> platform to work with :)
>
> Welcome!
>
>> What is y'all's preferred way to submit such a change?
>> Thanks!
>>
>
> Please use git format-patch or git send-email directly.
>
> lu - going back lurking...
>



-- 
-Dionna Glaze, PhD (she/her)
From b2524a4247af048908b9b5ea2fc9f71a11c0a845 Mon Sep 17 00:00:00 2001
From: Dionna Glaze <dionnaglaze@google.com>
Date: Mon, 26 Jun 2017 12:50:21 -0700
Subject: [PATCH] Make gethostname symbol available on more platforms.

---
 newlib/libc/include/sys/unistd.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 84219ca2e..6cbace987 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -212,7 +212,7 @@ long    _EXFUN(sysconf, (int __name ));
 pid_t   _EXFUN(tcgetpgrp, (int __fildes ));
 int     _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id ));
 char *  _EXFUN(ttyname, (int __fildes ));
-int     _EXFUN(ttyname_r, (int, char *, size_t)); 
+int     _EXFUN(ttyname_r, (int, char *, size_t));
 int     _EXFUN(unlink, (const char *__path ));
 int 	_EXFUN(usleep, (useconds_t __useconds));
 int     _EXFUN(vhangup, (void ));
@@ -263,12 +263,16 @@ int     _EXFUN(truncate, (const char *, off_t __length));
 int	_EXFUN(getdtablesize, (void));
 int	_EXFUN(setdtablesize, (int));
 useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval));
-#if !(defined  (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))
+char *	_EXFUN(mktemp, (char *));
+#endif
+
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K || \
+    ((defined(__CYGWIN__) || defined(__rtems__)) &&                       \
+     !(defined  (_WINSOCK_H) || defined (_WINSOCKAPI_) ||                 \
+       defined (__USE_W32_SOCKETS)))
 /* winsock[2].h defines as __stdcall, and with int as 2nd arg */
  int	_EXFUN(gethostname, (char *__name, size_t __len));
 #endif
-char *	_EXFUN(mktemp, (char *));
-#endif
 
 #if defined(__CYGWIN__) || defined(__SPU__) || defined(__rtems__)
 void    _EXFUN(sync, (void));
-- 
2.13.1.611.g7e3b11ae1-goog


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