This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: make-syscalls.sh


On Mon, Nov 19, 2012 at 4:16 AM,  <yili0568@gmail.com> wrote:
> Hello:
>     I've pulled the source codes of glibc,
>
> From make-syscalls.sh:
> # Syscall Signature Key Letters for BP Thunks:
> #
> # a: unchecked address (e.g., 1st arg to mmap)
> # b: non-NULL buffer (e.g., 2nd arg to read; return value from mmap)
> # B: optionally-NULL buffer (e.g., 4th arg to getsockopt)
> # f: buffer of 2 ints (e.g., 4th arg to socketpair)
> # F: 3rd arg to fcntl
> # i: scalar (any signedness & size: int, long, long long, enum, whatever)
> # I: 3rd arg to ioctl
> # n: scalar buffer length (e.g., 3rd arg to read)
> # N: pointer to value/return scalar buffer length (e.g., 6th arg to recvfrom)
> # p: non-NULL pointer to typed object (e.g., any non-void* arg)
> # P: optionally-NULL pointer to typed object (e.g., 2nd argument to gettimeofday)
> # s: non-NULL string (e.g., 1st arg to open)
> # S: optionally-NULL string (e.g., 1st arg to acct)
> # v: vararg scalar (e.g., optional 3rd arg to open)
> # V: byte-per-page vector (3rd arg to mincore)
> # W: wait status, optionally-NULL pointer to int (e.g., 2nd arg of wait4)
>
> and form sysdeps/unix/sysv/linux/syscalls.list
> # File name     Caller  Syscall name    Args    Strong name     Weak names
> ......
> creat           -       creat           Ci:si   __libc_creat creat
> .....
> clock_adjtime   EXTRA   clock_adjtime   i:ip    clock_adjtime
>
> What's "C" means. Is i:ip means "return type: arg1 type, arg2 type"?
> And what's the Caller means?

C is a prefix meaning that the syscall is cancellable.

I'll post the following patch upstream for inclusion...

--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -4,8 +4,19 @@
 # Expects $sysdirs in environment.

 ##############################################################################
-
-# Syscall Signature Key Letters for BP Thunks:
+#
+# This script is used to process the syscall data encoded in the various
+# syscalls.list files to produce thin assembly syscall wrappers around the
+# appropriate OS syscall. See syscall-template.s for more details on the
+# actual wrapper.
+#
+# Syscall Signature Prefixes:
+#
+# C: cancellable (e.g., this syscall is a cancellation point)
+# E: errno and return value are not set by the call
+# V: errno is not set, but errno or zero (success) is returned from the call
+#
+# Syscall Signature Key Letters:
 #
 # a: unchecked address (e.g., 1st arg to mmap)
 # b: non-NULL buffer (e.g., 2nd arg to read; return value from mmap)
@@ -23,6 +34,7 @@
 # v: vararg scalar (e.g., optional 3rd arg to open)
 # V: byte-per-page vector (3rd arg to mincore)
 # W: wait status, optionally-NULL pointer to int (e.g., 2nd arg of wait4)
+#

 ptr='[abBfFINpPsSWV]'  # all pointer keyletters
 int='[inv]'            # all scalar keyletters
---

Cheers,
Carlos.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]