This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: New contributor o/ hello, and small diff.
- From: "Dionna Amalie Glaze via newlib" <newlib at sourceware dot org>
- To: Luca Barbato <lu_zero at gentoo dot org>
- Cc: newlib at sourceware dot org
- Date: Mon, 26 Jun 2017 12:53:57 -0700
- Subject: Re: New contributor o/ hello, and small diff.
- Authentication-results: sourceware.org; auth=none
- References: <CAAH4kHaze9Z525RYuyr-VYpZUAN=S=N3phDME93rQGvB_H1=nw@mail.gmail.com> <a2d1ed88-4e77-ed66-a903-61318ab3a0c9@gentoo.org>
- Reply-to: Dionna Amalie Glaze <dionnaglaze at google dot com>
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