public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 3/4] Change register_t definition
  2019-02-18 13:06 [PATCH v2] Make some standard open() flags visible Sebastian Huber
  2019-02-18 13:06 ` [PATCH v2 4/4] Define u_register_t if __BSD_VISIBLE Sebastian Huber
  2019-02-18 13:06 ` [PATCH v2 2/4] Fix comment in <sys/types.h> Sebastian Huber
@ 2019-02-18 13:06 ` Sebastian Huber
  2019-02-18 13:06 ` [PATCH v2 1/4] Move RTEMS and XMK specific type definitions Sebastian Huber
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2019-02-18 13:06 UTC (permalink / raw)
  To: newlib

On 64-bit targets, the register_t type must be a 64-bit integer.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 newlib/libc/include/sys/types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index e5bd0294f..85f8ddb5f 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -36,7 +36,7 @@ typedef __uint32_t	u_int32_t;
 #if ___int64_t_defined
 typedef __uint64_t	u_int64_t;
 #endif
-typedef int register_t;
+typedef __intptr_t register_t;
 #define __BIT_TYPES_DEFINED__ 1
 
 #ifndef __need_inttypes
-- 
2.16.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/4] Move RTEMS and XMK specific type definitions
  2019-02-18 13:06 [PATCH v2] Make some standard open() flags visible Sebastian Huber
                   ` (2 preceding siblings ...)
  2019-02-18 13:06 ` [PATCH v2 3/4] Change register_t definition Sebastian Huber
@ 2019-02-18 13:06 ` Sebastian Huber
  2019-02-18 13:08 ` [PATCH v2] Make some standard open() flags visible Sebastian Huber
  2019-02-18 14:22 ` Corinna Vinschen
  5 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2019-02-18 13:06 UTC (permalink / raw)
  To: newlib

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 newlib/libc/include/machine/types.h           |  6 ++++++
 newlib/libc/include/sys/types.h               | 16 ----------------
 newlib/libc/sys/rtems/include/machine/types.h |  6 ++++++
 3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/newlib/libc/include/machine/types.h b/newlib/libc/include/machine/types.h
index a5a64e675..19d0e8560 100644
--- a/newlib/libc/include/machine/types.h
+++ b/newlib/libc/include/machine/types.h
@@ -5,3 +5,9 @@
 #ifndef _SYS_TYPES_H
 #error "must be included via <sys/types.h>"
 #endif /* !_SYS_TYPES_H */
+
+#if defined(__XMK__) && defined(___int64_t_defined)
+typedef	__uint64_t	u_quad_t;
+typedef	__int64_t	quad_t;
+typedef	quad_t *	qaddr_t;
+#endif
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 65ff520c8..2685df654 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -39,22 +39,6 @@ typedef __uint64_t	u_int64_t;
 typedef int register_t;
 #define __BIT_TYPES_DEFINED__ 1
 
-#if defined(__rtems__) || defined(__XMK__)
-/*
- *  The following section is RTEMS specific and is needed to more
- *  closely match the types defined in the BSD sys/types.h.
- *  This is needed to let the RTEMS/BSD TCP/IP stack compile.
- */
-
-/* deprecated */
-#if ___int64_t_defined
-typedef	__uint64_t	u_quad_t;
-typedef	__int64_t	quad_t;
-typedef	quad_t *	qaddr_t;
-#endif
-
-#endif /* __rtems__ || __XMK__ */
-
 #ifndef __need_inttypes
 
 #define _SYS_TYPES_H
diff --git a/newlib/libc/sys/rtems/include/machine/types.h b/newlib/libc/sys/rtems/include/machine/types.h
index ab52e47ed..c550873d3 100644
--- a/newlib/libc/sys/rtems/include/machine/types.h
+++ b/newlib/libc/sys/rtems/include/machine/types.h
@@ -62,6 +62,12 @@ typedef	__lwpid_t	lwpid_t;	/* Thread ID (a.k.a. LWP) */
 #define	_LWPID_T_DECLARED
 #endif
 
+#if ___int64_t_defined
+typedef	__uint64_t	u_quad_t;
+typedef	__int64_t	quad_t;
+typedef	quad_t *	qaddr_t;
+#endif
+
 #ifndef _RLIM_T_DECLARED
 typedef	__rlim_t	rlim_t;		/* resource limit */
 #define	_RLIM_T_DECLARED
-- 
2.16.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 4/4] Define u_register_t if __BSD_VISIBLE
  2019-02-18 13:06 [PATCH v2] Make some standard open() flags visible Sebastian Huber
@ 2019-02-18 13:06 ` Sebastian Huber
  2019-02-18 13:06 ` [PATCH v2 2/4] Fix comment in <sys/types.h> Sebastian Huber
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2019-02-18 13:06 UTC (permalink / raw)
  To: newlib

Add u_register_t definition for FreeBSD compatibility.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 newlib/libc/include/sys/types.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 85f8ddb5f..19e3de689 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -62,6 +62,8 @@ typedef	__uint32_t	in_addr_t;	/* base type for internet address */
 typedef	__uint16_t	in_port_t;
 #define	_IN_PORT_T_DECLARED
 #endif
+
+typedef	__uintptr_t	u_register_t;
 #endif /* __BSD_VISIBLE */
 
 #if __MISC_VISIBLE
-- 
2.16.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 2/4] Fix comment in <sys/types.h>
  2019-02-18 13:06 [PATCH v2] Make some standard open() flags visible Sebastian Huber
  2019-02-18 13:06 ` [PATCH v2 4/4] Define u_register_t if __BSD_VISIBLE Sebastian Huber
@ 2019-02-18 13:06 ` Sebastian Huber
  2019-02-18 13:06 ` [PATCH v2 3/4] Change register_t definition Sebastian Huber
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2019-02-18 13:06 UTC (permalink / raw)
  To: newlib

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 newlib/libc/include/sys/types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 2685df654..e5bd0294f 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -85,7 +85,7 @@ typedef	unsigned long	u_long;
 #endif
 #define _BSDTYPES_DEFINED
 #endif
-#endif	/*__BSD_VISIBLE || __CYGWIN__ */
+#endif /* __MISC_VISIBLE */
 
 #if __MISC_VISIBLE
 typedef	unsigned short	ushort;		/* System V compatibility */
-- 
2.16.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] Make some standard open() flags visible
@ 2019-02-18 13:06 Sebastian Huber
  2019-02-18 13:06 ` [PATCH v2 4/4] Define u_register_t if __BSD_VISIBLE Sebastian Huber
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Sebastian Huber @ 2019-02-18 13:06 UTC (permalink / raw)
  To: newlib

Make the POSIX O_CLOEXEC, O_NOFOLLOW, O_DIRECTORY, O_EXEC, and O_SEARCH
open() flags available also to non-Cygwin systems.

Make the BSD/glibc O_DIRECT open() flag  available also to non-Cygwin
systems.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 newlib/libc/include/sys/_default_fcntl.h | 48 ++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h
index 33b462285..22fa10688 100644
--- a/newlib/libc/include/sys/_default_fcntl.h
+++ b/newlib/libc/include/sys/_default_fcntl.h
@@ -23,6 +23,19 @@ extern "C" {
 #define	_FNONBLOCK	0x4000	/* non blocking I/O (POSIX style) */
 #define	_FNDELAY	_FNONBLOCK	/* non blocking I/O (4.2 style) */
 #define	_FNOCTTY	0x8000	/* don't assign a ctty on this open */
+#if defined (__CYGWIN__)
+#define	_FBINARY	0x10000
+#define	_FTEXT		0x20000
+#endif
+#define	_FNOINHERIT	0x40000
+#define	_FDIRECT	0x80000
+#define	_FNOFOLLOW	0x100000
+#define	_FDIRECTORY	0x200000
+#define	_FEXECSRCH	0x400000
+#if defined (__CYGWIN__)
+#define	_FTMPFILE	0x800000
+#define	_FNOATIME	0x1000000
+#endif
 
 #define	O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
 
@@ -43,35 +56,28 @@ extern "C" {
 /*	O_NDELAY	_FNBIO 		set in include/fcntl.h */
 #define	O_NONBLOCK	_FNONBLOCK
 #define	O_NOCTTY	_FNOCTTY
-/* For machines which care - */
-#if defined (__CYGWIN__)
-#define _FBINARY        0x10000
-#define _FTEXT          0x20000
-#define _FNOINHERIT	0x40000
-#define _FDIRECT        0x80000
-#define _FNOFOLLOW      0x100000
-#define _FDIRECTORY     0x200000
-#define _FEXECSRCH      0x400000
-#define _FTMPFILE       0x800000
-#define _FNOATIME       0x1000000
 
+/* POSIX-1.2008 specific flags */
+#if __POSIX_VISIBLE >= 200809
+#define	O_CLOEXEC	_FNOINHERIT
+#define	O_NOFOLLOW	_FNOFOLLOW
+#define	O_DIRECTORY	_FDIRECTORY
+#define	O_EXEC		_FEXECSRCH
+#define	O_SEARCH	_FEXECSRCH
+#endif
+
+#if __BSD_VISIBLE
+#define	O_DIRECT	_FDIRECT
+#endif
+
+#if defined (__CYGWIN__)
 #define O_BINARY	_FBINARY
 #define O_TEXT		_FTEXT
 #define O_DSYNC         _FSYNC
 #define O_RSYNC         _FSYNC
-#define O_EXEC          _FEXECSRCH
-#define O_SEARCH        _FEXECSRCH
-
-/* POSIX-1.2008 specific flags */
-#if __POSIX_VISIBLE >= 200809
-#define O_CLOEXEC	_FNOINHERIT
-#define O_NOFOLLOW      _FNOFOLLOW
-#define O_DIRECTORY     _FDIRECTORY
-#endif
 
 /* Linux-specific flags */
 #if __GNU_VISIBLE
-#define O_DIRECT        _FDIRECT
 #define O_TMPFILE	_FTMPFILE
 #define O_NOATIME	_FNOATIME
 #endif
-- 
2.16.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Make some standard open() flags visible
  2019-02-18 13:06 [PATCH v2] Make some standard open() flags visible Sebastian Huber
                   ` (3 preceding siblings ...)
  2019-02-18 13:06 ` [PATCH v2 1/4] Move RTEMS and XMK specific type definitions Sebastian Huber
@ 2019-02-18 13:08 ` Sebastian Huber
  2019-02-18 14:22 ` Corinna Vinschen
  5 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2019-02-18 13:08 UTC (permalink / raw)
  To: newlib

On 18/02/2019 14:06, Sebastian Huber wrote:
> Make the POSIX O_CLOEXEC, O_NOFOLLOW, O_DIRECTORY, O_EXEC, and O_SEARCH
> open() flags available also to non-Cygwin systems.
>
> Make the BSD/glibc O_DIRECT open() flag  available also to non-Cygwin
> systems.
>
> Signed-off-by: Sebastian Huber<sebastian.huber@embedded-brains.de>
> ---
>   newlib/libc/include/sys/_default_fcntl.h | 48 ++++++++++++++++++--------------
>   1 file changed, 27 insertions(+), 21 deletions(-)

Sorry, this was a left over patch file. It is already included in Newlib.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Make some standard open() flags visible
  2019-02-18 13:06 [PATCH v2] Make some standard open() flags visible Sebastian Huber
                   ` (4 preceding siblings ...)
  2019-02-18 13:08 ` [PATCH v2] Make some standard open() flags visible Sebastian Huber
@ 2019-02-18 14:22 ` Corinna Vinschen
  2019-02-18 14:26   ` Corinna Vinschen
  5 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2019-02-18 14:22 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

On Feb 18 14:06, Sebastian Huber wrote:
> Make the POSIX O_CLOEXEC, O_NOFOLLOW, O_DIRECTORY, O_EXEC, and O_SEARCH
> open() flags available also to non-Cygwin systems.
> 
> Make the BSD/glibc O_DIRECT open() flag  available also to non-Cygwin
> systems.
> 
> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
> ---
>  newlib/libc/include/sys/_default_fcntl.h | 48 ++++++++++++++++++--------------
>  1 file changed, 27 insertions(+), 21 deletions(-)
> 
> diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h
> index 33b462285..22fa10688 100644
> --- a/newlib/libc/include/sys/_default_fcntl.h
> +++ b/newlib/libc/include/sys/_default_fcntl.h
> @@ -23,6 +23,19 @@ extern "C" {
>  #define	_FNONBLOCK	0x4000	/* non blocking I/O (POSIX style) */
>  #define	_FNDELAY	_FNONBLOCK	/* non blocking I/O (4.2 style) */
>  #define	_FNOCTTY	0x8000	/* don't assign a ctty on this open */
> +#if defined (__CYGWIN__)
> +#define	_FBINARY	0x10000
> +#define	_FTEXT		0x20000
> +#endif
> +#define	_FNOINHERIT	0x40000
> +#define	_FDIRECT	0x80000
> +#define	_FNOFOLLOW	0x100000
> +#define	_FDIRECTORY	0x200000
> +#define	_FEXECSRCH	0x400000
> +#if defined (__CYGWIN__)
> +#define	_FTMPFILE	0x800000
> +#define	_FNOATIME	0x1000000
> +#endif

This patch looks a bit... outdated?


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Make some standard open() flags visible
  2019-02-18 14:22 ` Corinna Vinschen
@ 2019-02-18 14:26   ` Corinna Vinschen
  0 siblings, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2019-02-18 14:26 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]

On Feb 18 15:22, Corinna Vinschen wrote:
> On Feb 18 14:06, Sebastian Huber wrote:
> > Make the POSIX O_CLOEXEC, O_NOFOLLOW, O_DIRECTORY, O_EXEC, and O_SEARCH
> > open() flags available also to non-Cygwin systems.
> > 
> > Make the BSD/glibc O_DIRECT open() flag  available also to non-Cygwin
> > systems.
> > 
> > Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
> > ---
> >  newlib/libc/include/sys/_default_fcntl.h | 48 ++++++++++++++++++--------------
> >  1 file changed, 27 insertions(+), 21 deletions(-)
> > 
> > diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h
> > index 33b462285..22fa10688 100644
> > --- a/newlib/libc/include/sys/_default_fcntl.h
> > +++ b/newlib/libc/include/sys/_default_fcntl.h
> > @@ -23,6 +23,19 @@ extern "C" {
> >  #define	_FNONBLOCK	0x4000	/* non blocking I/O (POSIX style) */
> >  #define	_FNDELAY	_FNONBLOCK	/* non blocking I/O (4.2 style) */
> >  #define	_FNOCTTY	0x8000	/* don't assign a ctty on this open */
> > +#if defined (__CYGWIN__)
> > +#define	_FBINARY	0x10000
> > +#define	_FTEXT		0x20000
> > +#endif
> > +#define	_FNOINHERIT	0x40000
> > +#define	_FDIRECT	0x80000
> > +#define	_FNOFOLLOW	0x100000
> > +#define	_FDIRECTORY	0x200000
> > +#define	_FEXECSRCH	0x400000
> > +#if defined (__CYGWIN__)
> > +#define	_FTMPFILE	0x800000
> > +#define	_FNOATIME	0x1000000
> > +#endif
> 
> This patch looks a bit... outdated?

I missed to read the whole thread before replying, sorry.

The other patches look ok, please push.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-02-18 14:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 13:06 [PATCH v2] Make some standard open() flags visible Sebastian Huber
2019-02-18 13:06 ` [PATCH v2 4/4] Define u_register_t if __BSD_VISIBLE Sebastian Huber
2019-02-18 13:06 ` [PATCH v2 2/4] Fix comment in <sys/types.h> Sebastian Huber
2019-02-18 13:06 ` [PATCH v2 3/4] Change register_t definition Sebastian Huber
2019-02-18 13:06 ` [PATCH v2 1/4] Move RTEMS and XMK specific type definitions Sebastian Huber
2019-02-18 13:08 ` [PATCH v2] Make some standard open() flags visible Sebastian Huber
2019-02-18 14:22 ` Corinna Vinschen
2019-02-18 14:26   ` Corinna Vinschen

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).