public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/27508] New: expose a variadic form of syscall, by analogy with vprintf, vscanf, and verr
@ 2021-03-03 17:21 dkg at fifthhorseman dot net
  0 siblings, 0 replies; only message in thread
From: dkg at fifthhorseman dot net @ 2021-03-03 17:21 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 27508
           Summary: expose a variadic form of syscall, by analogy with
                    vprintf, vscanf, and verr
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: dkg at fifthhorseman dot net
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

In some circumstances, a variadic function might want to invoke `syscall` with
its variadic arguments.

To do this cleanly, we'd need glibc to export a variadic variant of `syscall`,
by analogy with `vprintf`, `verr`, and `vscanf`.

For contrived usage example, consider some code that tries to dispatch a
variadic function call either to some internal implementation or to a syscall:

#define SYSCALL_NUMBER XXXX
int foo(handler_t handler, ...) {
 va_list ap;
 va_start(ap, handler);
 if (handler == HANDLER_INTERNAL) {
   handle_internally(ap);
 else if (handler == HANDLE_SYSCALL) {
   vararg_syscall(SYSCALL_NUMBER, ap);
 }
}


If you want a non-contrived example, this has come up for `faketime`, which is
used for intercepting/bypassing some time-specific low-level functionality:

   https://github.com/wolfcw/libfaketime/issues/176

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-03 17:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 17:21 [Bug libc/27508] New: expose a variadic form of syscall, by analogy with vprintf, vscanf, and verr dkg at fifthhorseman dot net

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