netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: akpm@linux-foundation.org, davidel@xmailserver.org,
	mtk.manpages@gmail.com, torvalds@linux-foundation.org
Subject: [PATCH 00/18] flag parameters
Date: Tue, 6 May 2008 17:18:07 -0400	[thread overview]
Message-ID: <200805062118.m46LI7AF004035@devserv.devel.redhat.com> (raw)

This is an update for the previous series which should address the
comments Andrew had.  The controversial function Davide wrote is gone.
There is no flag conversion anymore.  We still introduce new names for
the constants but the values are the same as the O_* constants.

This leads to some strange-looking code where we in one moment check
for, say, SOCK_CLOEXEC, and in the next for O_CLOEXEC.  But I added
in a separate, new patch code which checks for the consistency of the
constants.

I modified the headers in <linux/*> to define the new values by
include <linux/fcntl.h> and then simply define the new constants
based on the O_* constants.  That's the safest a nd least troublesome
way.  Otherwise we would have to create arch-specific headers.  None
of the modified headers should be used by userlevel code.  Therefore
the namespace pollution is no issue.

For those who just turn in, these patches add flags to various functions
so that new file descriptors can be created with atomically setting the
close-on-exec flag.  This is critical, in multi-threaded apps we otherwise
can have file descriptor leakage or worse.  Since it is so either and
often needed, I also added code to create new file descriptors with
O_NONBLOCK set.

In future there will be other uses.  Like a O_* flag to enable the use
of non-sequential descriptors.

Some interfaces are not exported at userlevel with enough flexibility
to allow extending them.  For those we need new userlevel interface.
This is the case for:

 - paccept
 - epoll_create2
 - dup3
 - pipe2
 - inotify_init1

We do /not/ need new interfaces for

 - signalfd4
 - eventfd2
 - timerfd_create
 - socket
 - socketpair

These either have flags parameters in the interface exported by glibc
or (in case of the socket functions) overload a parameter with a bitset.

Each semantic change has a test program.  For archs other than x86 and
x86-64 you'll have to add the appropriate syscall number.

The patches all apply individually in sequence and the source tree
remains compilable and runnable.

             reply	other threads:[~2008-05-06 21:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 21:18 Ulrich Drepper [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-05-05  3:42 [PATCH 00/18] flag parameters Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200805062118.m46LI7AF004035@devserv.devel.redhat.com \
    --to=drepper@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).