public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/28730] Extend posix_spawnattr_* interface with more useful features
Date: Mon, 10 Jan 2022 14:54:42 +0000	[thread overview]
Message-ID: <bug-28730-131-vBlY6I0HyX@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28730-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28730

--- Comment #6 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Cristian Rodríguez from comment #5)
> So the best way way would be to use the pad space to introduce a an internal
> opaque struct  which we can modify or extend at will ? even with all
> implementation-defined leisure we still shouldn't break the ABI..

Yes, although I would first use the current space available and keep space for
a pointer to allow extend the functionaly.  Something like:

  typedef struct
  {
    short int __flags;
    pid_t __pgrp;
    sigset_t __sd;
    sigset_t __ss;
    struct sched_param __sp;
    int __policy;
    /* Add newer fields here.  */
    int __pad[N];
    void *__reserved/
  } posix_spawnattr_t;

So for posix_spawnattr_setpdeathsig_np it would be something like:

  typedef struct
  {
    short int __flags;
    pid_t __pgrp;
    sigset_t __sd;
    sigset_t __ss;
    struct sched_param __sp;
    int __policy;
    int __deathsignal;
    int __pad[M];
  } posix_spawnattr_t;

With M adjusted to keep the current size. For posix_spawnattr_setrlimit_np I
would do:

  typedef struct
  {
    short int __flags;
    pid_t __pgrp;
    sigset_t __sd;
    sigset_t __ss;
    struct sched_param __sp;
    int __policy;
    int __deathsignal;
    void *__resource;
    int __pad[M];
  } posix_spawnattr_t;

And internally '__resource' will be array of:

  struct posix_spawn_resource
  {
    int resource;
    struct rlimit64 rlim;
  }

(The rlimit has the LFS issue, so I think it shold be supported only for LFS
mode).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-01-10 14:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-28 20:24 [Bug libc/28730] New: " crrodriguez at opensuse dot org
2021-12-28 20:47 ` [Bug libc/28730] " crrodriguez at opensuse dot org
2022-01-06 14:22 ` adhemerval.zanella at linaro dot org
2022-01-06 21:47 ` crrodriguez at opensuse dot org
2022-01-07 12:17 ` adhemerval.zanella at linaro dot org
2022-01-09 14:07 ` crrodriguez at opensuse dot org
2022-01-10 14:54 ` adhemerval.zanella at linaro dot org [this message]
2022-01-10 15:12 ` fweimer at redhat dot com
2022-01-10 17:17 ` crrodriguez at opensuse dot org
2022-01-10 18:34 ` adhemerval.zanella at linaro dot org

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=bug-28730-131-vBlY6I0HyX@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).