* New contributor o/ hello, and small diff.
@ 2017-06-26 18:45 Dionna Amalie Glaze via newlib
2017-06-26 19:41 ` Luca Barbato
0 siblings, 1 reply; 7+ messages in thread
From: Dionna Amalie Glaze via newlib @ 2017-06-26 18:45 UTC (permalink / raw)
To: newlib
Hi y'all! Thank you so much for your work on newlib. It's a fantastic
platform to work with :)
I am looking at getting access to the gethostname symbol in
sys/unistd.h outside of __CYGWIN__ or __rtems__. The following
platforms by C preprocessor symbol would be a helpful addition:
__USE_BSD, __USE_UNIX98, __USE_XOPEN2K
In diff form,
==== /home/dionnaglaze/newlib-cygwin/newlib/src/newlib/libc/include/sys/unistd.h
====
247c247,253
< #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)))
250,251d255
< #endif
< char * _EXFUN(mktemp, (char *));
What is y'all's preferred way to submit such a change?
Thanks!
--
-Dionna Glaze, PhD (she/her)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: New contributor o/ hello, and small diff.
2017-06-26 18:45 New contributor o/ hello, and small diff Dionna Amalie Glaze via newlib
@ 2017-06-26 19:41 ` Luca Barbato
2017-06-26 19:54 ` Dionna Amalie Glaze via newlib
0 siblings, 1 reply; 7+ messages in thread
From: Luca Barbato @ 2017-06-26 19:41 UTC (permalink / raw)
To: newlib
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...
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: New contributor o/ hello, and small diff.
2017-06-26 19:41 ` Luca Barbato
@ 2017-06-26 19:54 ` Dionna Amalie Glaze via newlib
2017-06-27 17:43 ` Yaakov Selkowitz
0 siblings, 1 reply; 7+ messages in thread
From: Dionna Amalie Glaze via newlib @ 2017-06-26 19:54 UTC (permalink / raw)
To: Luca Barbato; +Cc: newlib
[-- Attachment #1: Type: text/plain, Size: 494 bytes --]
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)
[-- Attachment #2: 0001-Make-gethostname-symbol-available-on-more-platforms.patch --]
[-- Type: text/x-patch, Size: 1898 bytes --]
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: New contributor o/ hello, and small diff.
2017-06-26 19:54 ` Dionna Amalie Glaze via newlib
@ 2017-06-27 17:43 ` Yaakov Selkowitz
2017-06-27 18:10 ` Dionna Amalie Glaze via newlib
0 siblings, 1 reply; 7+ messages in thread
From: Yaakov Selkowitz @ 2017-06-27 17:43 UTC (permalink / raw)
To: newlib
On 2017-06-26 14:53, Dionna Amalie Glaze via newlib wrote:
> The formatted patch is attached.
This patch is incorrect. __USE_* are glibc internals; we use the
__*_VISIBLE internal macros as defined and documented in sys/features.h.
--
Yaakov
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: New contributor o/ hello, and small diff.
2017-06-27 17:43 ` Yaakov Selkowitz
@ 2017-06-27 18:10 ` Dionna Amalie Glaze via newlib
2017-06-29 6:39 ` Corinna Vinschen
0 siblings, 1 reply; 7+ messages in thread
From: Dionna Amalie Glaze via newlib @ 2017-06-27 18:10 UTC (permalink / raw)
To: Yaakov Selkowitz; +Cc: newlib
[-- Attachment #1: Type: text/plain, Size: 655 bytes --]
Thanks for the correction, Yaakov. Is the updated patch acceptable? It
pulls in some other symbols too, but the man pages for all those
symbols should be supported with __BSD_VISIBLE or __XSI_VISIBLE >=
500.
The other edit removes the only trailing whitespace in the file.
On Tue, Jun 27, 2017 at 10:43 AM, Yaakov Selkowitz
<yselkowitz@cygwin.com> wrote:
> On 2017-06-26 14:53, Dionna Amalie Glaze via newlib wrote:
>>
>> The formatted patch is attached.
>
>
> This patch is incorrect. __USE_* are glibc internals; we use the
> __*_VISIBLE internal macros as defined and documented in sys/features.h.
>
> --
> Yaakov
--
-Dionna Glaze, PhD (she/her)
[-- Attachment #2: 0001-Make-gethostname-getdtablesize-mktemp-ualarm-availab.patch --]
[-- Type: text/x-patch, Size: 1918 bytes --]
From 339b855ff14aec73bf9527f4cc84f9a620e2bbe3 Mon Sep 17 00:00:00 2001
From: Dionna Glaze <dionnaglaze@google.com>
Date: Tue, 27 Jun 2017 11:07:48 -0700
Subject: [PATCH] Make gethostname, getdtablesize, mktemp, ualarm available in
BSD, XOPEN_SOURCE >= 500.
---
newlib/libc/include/sys/unistd.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 84219ca2e..ded632279 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 ));
@@ -259,9 +259,9 @@ int _EXFUN(truncate, (const char *, off_t __length));
#endif
#endif
-#if defined(__CYGWIN__) || defined(__rtems__)
+#if defined(__CYGWIN__) || defined(__rtems__) || defined(__BSD_VISIBLE) || \
+ (__XSI_VISIBLE >= 500)
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))
/* winsock[2].h defines as __stdcall, and with int as 2nd arg */
@@ -270,6 +270,10 @@ useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval));
char * _EXFUN(mktemp, (char *));
#endif
+#if defined(__CYGWIN__) || defined(__rtems__)
+int _EXFUN(setdtablesize, (int));
+#endif
+
#if defined(__CYGWIN__) || defined(__SPU__) || defined(__rtems__)
void _EXFUN(sync, (void));
#endif
--
2.13.1.611.g7e3b11ae1-goog
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: New contributor o/ hello, and small diff.
2017-06-27 18:10 ` Dionna Amalie Glaze via newlib
@ 2017-06-29 6:39 ` Corinna Vinschen
2017-06-29 16:12 ` Dionna Amalie Glaze via newlib
0 siblings, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2017-06-29 6:39 UTC (permalink / raw)
To: newlib
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
On Jun 27 11:10, Dionna Amalie Glaze via newlib wrote:
> Thanks for the correction, Yaakov. Is the updated patch acceptable? It
> pulls in some other symbols too, but the man pages for all those
> symbols should be supported with __BSD_VISIBLE or __XSI_VISIBLE >=
> 500.
> The other edit removes the only trailing whitespace in the file.
Patch applied with a change. I dropped the __CYGWIN__ and __rtems__
checks entirely. __BSD_VISIBLE || __XSI_VISIBLE >= 500 should be
sufficient.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: New contributor o/ hello, and small diff.
2017-06-29 6:39 ` Corinna Vinschen
@ 2017-06-29 16:12 ` Dionna Amalie Glaze via newlib
0 siblings, 0 replies; 7+ messages in thread
From: Dionna Amalie Glaze via newlib @ 2017-06-29 16:12 UTC (permalink / raw)
To: newlib
Thanks for the fast turnaround :)
-Dionna
On Wed, Jun 28, 2017 at 11:35 PM, Corinna Vinschen <vinschen@redhat.com> wrote:
> On Jun 27 11:10, Dionna Amalie Glaze via newlib wrote:
>> Thanks for the correction, Yaakov. Is the updated patch acceptable? It
>> pulls in some other symbols too, but the man pages for all those
>> symbols should be supported with __BSD_VISIBLE or __XSI_VISIBLE >=
>> 500.
>> The other edit removes the only trailing whitespace in the file.
>
> Patch applied with a change. I dropped the __CYGWIN__ and __rtems__
> checks entirely. __BSD_VISIBLE || __XSI_VISIBLE >= 500 should be
> sufficient.
>
>
> Thanks,
> Corinna
>
> --
> Corinna Vinschen
> Cygwin Maintainer
> Red Hat
--
-Dionna Glaze, PhD (she/her)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-06-29 16:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 18:45 New contributor o/ hello, and small diff Dionna Amalie Glaze via newlib
2017-06-26 19:41 ` Luca Barbato
2017-06-26 19:54 ` Dionna Amalie Glaze via newlib
2017-06-27 17:43 ` Yaakov Selkowitz
2017-06-27 18:10 ` Dionna Amalie Glaze via newlib
2017-06-29 6:39 ` Corinna Vinschen
2017-06-29 16:12 ` Dionna Amalie Glaze via newlib
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).