* kqueue.c and <sys/file.h>
@ 2018-01-05 13:33 Jeremie Courreges-Anglas
2018-01-05 14:09 ` Michael Albinus
0 siblings, 1 reply; 5+ messages in thread
From: Jeremie Courreges-Anglas @ 2018-01-05 13:33 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]
Hi,
While sys/file.h has been around since some time now, it is not part of
the POSIX standard (or any standard that I know of), and it looks like
most of its consumers really want to include <fcntl.h> instead to access
the various O_* #defines used by open(2).
Within Emacs, src/kqueue.c seems to be the only source file that depends
on sys/file.h to build on OpenBSD. As discussed with Michael Albinus,
I'd suggest using fcntl.h there (trivial diff below). I guess it should
be tested on other systems that provide kqueue(2) (*BSD, OSX, ?) but
I don't expect fallout.
diff --git a/src/kqueue.c b/src/kqueue.c
index 69d5269d302..7a4f6a471c4 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -24,7 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
-#include <sys/file.h>
+#include <fcntl.h>
#include "lisp.h"
#include "keyboard.h"
#include "process.h"
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: kqueue.c and <sys/file.h>
2018-01-05 13:33 kqueue.c and <sys/file.h> Jeremie Courreges-Anglas
@ 2018-01-05 14:09 ` Michael Albinus
2018-01-13 17:44 ` Michael Albinus
0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2018-01-05 14:09 UTC (permalink / raw)
To: emacs-devel
Jeremie Courreges-Anglas <jca@wxcvbn.org> writes:
> Hi,
Hi Jeremie,
> While sys/file.h has been around since some time now, it is not part of
> the POSIX standard (or any standard that I know of), and it looks like
> most of its consumers really want to include <fcntl.h> instead to access
> the various O_* #defines used by open(2).
>
> Within Emacs, src/kqueue.c seems to be the only source file that depends
> on sys/file.h to build on OpenBSD. As discussed with Michael Albinus,
> I'd suggest using fcntl.h there (trivial diff below). I guess it should
> be tested on other systems that provide kqueue(2) (*BSD, OSX, ?) but
> I don't expect fallout.
Thanks for this! Pls provide also a ChangeLog entry with reasoning for
this patch.
Let's wait a week or so. If nobody complains, I'll commit the patch to
the master branch then, in your name.
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kqueue.c and <sys/file.h>
2018-01-05 14:09 ` Michael Albinus
@ 2018-01-13 17:44 ` Michael Albinus
2018-01-14 14:18 ` Jeremie Courreges-Anglas
0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2018-01-13 17:44 UTC (permalink / raw)
To: Jeremie Courreges-Anglas; +Cc: emacs-devel
Michael Albinus <michael.albinus@gmx.de> writes:
Hi Jeremie,
>> While sys/file.h has been around since some time now, it is not part of
>> the POSIX standard (or any standard that I know of), and it looks like
>> most of its consumers really want to include <fcntl.h> instead to access
>> the various O_* #defines used by open(2).
>>
>> Within Emacs, src/kqueue.c seems to be the only source file that depends
>> on sys/file.h to build on OpenBSD. As discussed with Michael Albinus,
>> I'd suggest using fcntl.h there (trivial diff below). I guess it should
>> be tested on other systems that provide kqueue(2) (*BSD, OSX, ?) but
>> I don't expect fallout.
>
> Thanks for this! Pls provide also a ChangeLog entry with reasoning for
> this patch.
>
> Let's wait a week or so. If nobody complains, I'll commit the patch to
> the master branch then, in your name.
Nobody has complained, so the patch will be applied. Could you pls send
me the ChangeLog entry with reasoning?
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kqueue.c and <sys/file.h>
2018-01-13 17:44 ` Michael Albinus
@ 2018-01-14 14:18 ` Jeremie Courreges-Anglas
2018-01-15 8:15 ` Michael Albinus
0 siblings, 1 reply; 5+ messages in thread
From: Jeremie Courreges-Anglas @ 2018-01-14 14:18 UTC (permalink / raw)
To: Michael Albinus; +Cc: emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 1207 bytes --]
On Sat, Jan 13 2018, Michael Albinus <michael.albinus@gmx.de> wrote:
> Michael Albinus <michael.albinus@gmx.de> writes:
>
> Hi Jeremie,
Hi,
>>> While sys/file.h has been around since some time now, it is not part of
>>> the POSIX standard (or any standard that I know of), and it looks like
>>> most of its consumers really want to include <fcntl.h> instead to access
>>> the various O_* #defines used by open(2).
>>>
>>> Within Emacs, src/kqueue.c seems to be the only source file that depends
>>> on sys/file.h to build on OpenBSD. As discussed with Michael Albinus,
>>> I'd suggest using fcntl.h there (trivial diff below). I guess it should
>>> be tested on other systems that provide kqueue(2) (*BSD, OSX, ?) but
>>> I don't expect fallout.
>>
>> Thanks for this! Pls provide also a ChangeLog entry with reasoning for
>> this patch.
>>
>> Let's wait a week or so. If nobody complains, I'll commit the patch to
>> the master branch then, in your name.
>
> Nobody has complained, so the patch will be applied. Could you pls send
> me the ChangeLog entry with reasoning?
Here is a patch.
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Prefer-fcntl.h-to-sys-file.h.patch --]
[-- Type: text/x-patch, Size: 814 bytes --]
From 50ea2795c883cb1e67506706b9ce64565da13e7a Mon Sep 17 00:00:00 2001
From: Jeremie Courreges-Anglas <jca@wxcvbn.org>
Date: Sun, 14 Jan 2018 15:03:44 +0100
Subject: [PATCH] Prefer fcntl.h to sys/file.h
* src/kqueue.c: Use fcntl.h (specified by POSIX) instead of
non-standard sys/file.h to access O_* open(2) flags.
---
src/kqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kqueue.c b/src/kqueue.c
index 69d5269d302..7a4f6a471c4 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -24,7 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
-#include <sys/file.h>
+#include <fcntl.h>
#include "lisp.h"
#include "keyboard.h"
#include "process.h"
--
2.15.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: kqueue.c and <sys/file.h>
2018-01-14 14:18 ` Jeremie Courreges-Anglas
@ 2018-01-15 8:15 ` Michael Albinus
0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2018-01-15 8:15 UTC (permalink / raw)
To: emacs-devel
Jeremie Courreges-Anglas <jca@wxcvbn.org> writes:
> Hi,
Hi Jeremie,
>> Nobody has complained, so the patch will be applied. Could you pls send
>> me the ChangeLog entry with reasoning?
>
> Here is a patch.
Thanks. I've pushed this to the master branch.
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-15 8:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-05 13:33 kqueue.c and <sys/file.h> Jeremie Courreges-Anglas
2018-01-05 14:09 ` Michael Albinus
2018-01-13 17:44 ` Michael Albinus
2018-01-14 14:18 ` Jeremie Courreges-Anglas
2018-01-15 8:15 ` Michael Albinus
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.