Kerrisk, Arguments passes via registers when syscall() calls. but each register size is 32 bit wide. So, when 64bit argument passes, it split into two registers. But according to ABI by ARM, 64 bit arguments should be start with an even number of register (e.g. r0, r2) so, in the example, 'offset' should be started on an even number of register like below r0 : fd r1 : 0 (dummy value) r2 : offset high r3 : offset low if '0' is omitted, system call handler mis-interpreted the value and a garbage value is in 'offset' I will correct the notes and submit it again soon... Mike, do you have any suggestion to correct my expression? ( include alignment....? ) ---------- Original Message ---------- >From : "Michael Kerrisk (man-pages)" <mtk.manpages@xxxxxxxxx> To : Mike Frysinger <vapier@xxxxxxxxxx> Cc : 한창희 연구원(ch0.han), linux-man <linux-man@xxxxxxxxxxxxxxx>, 이건호 책임연구원(gunho.lee) Date : 13/4/1 15:23:08 Subject : Re: [PATCH] man2 : syscall.2 : add notes Mike, On Mon, Apr 1, 2013 at 8:13 AM, Mike Frysinger wrote: > On Monday 01 April 2013 01:33:49 Changhee Han wrote: >> +Each architecture ABI has its own requirements on how system call >> arguments are passed to the kernel. +For system calls that have a glibc >> wrapper (i.g., most system calls) glibc handles the details of copy >> arguments to the right registers in a manner suitable for the >> architecture. > > these lines need to be wrapped > > "i.g." is incorrect ... you mean "i.e." > >> +However, when using >> +.BR syscall () >> +to make a system call, >> +the caller may need to handle architecture-dependent details. >> +For example, on ARM architecture, a >> +.I "long long" >> +argument is considered to be 8-byte aligned and to be split into two >> 4-byte arguments. + >> +.BR readahead () >> +system call could be called like below in ARM architecture. > > this has nothing to do with alignment. syscalls pass args via registers, and > in the 32bit ARM port, registers are 32bits wide. so in order to pass a 64bit > value, you have to manually split it up. So, I'm not familiar with all the details here. What is the purpose of the '0' argument that precedes 'offset' then? Cheers, Michaelÿ淸º{.nÇ+돴윯돪†+%듚ÿ깁負¥Šwÿº{.nÇ+돴¥Š{깸f?)í끾èw*jgП¨¶‰šŽ듶¢jÿ¾?G«앶ÿ◀◁¦j:+v돣ŠwèjØm¶Ÿÿ?®w?듺þf"·hš뤴얎ÿ녪¥