Bug 427194 - `__NR__llseek' undeclared
`__NR__llseek' undeclared
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: 4Suite (Show other bugs)
4.0
x86_64 Linux
low Severity urgent
: rc
: ---
Assigned To: Miloslav Trmač
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-02 03:21 EST by Shang Jie
Modified: 2008-01-02 04:27 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-02 03:36:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Shang Jie 2008-01-02 03:21:09 EST
Description of problem:
When I complied softwarce(wrttien in C language), some errors were found as
following:

gcc  -I../../include -DSTDC -g    -c gcf_disk.c -o gcf_disk.o
gcf_disk.c: In function `_llseek':
gcf_disk.c:409: error: `__NR__llseek' undeclared (first use in this function)
gcf_disk.c:409: error: (Each undeclared identifier is reported only once
gcf_disk.c:409: error: for each function it appears in.)
make[1]: *** [gcf_disk.o] Error 1

How reproducible:
someway this is difficult to reproduce, but I should declare that the same
problem has been reported to debian Linux on Nov 2004 by someone else and I do
NOT know how they fixed it. I just put some relative code here for you to analyze:
#ifdef LINUX
/* this is a long long! */
loff_t res, byte_request;

int ret;
unsigned long off_high, off_low;
_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh);
#endif

Steps to Reproduce:
Actual results:
Expected results:
Additional info:
Comment 1 Shang Jie 2008-01-02 03:27:53 EST
linux/unistd.h has been included aready!
Comment 2 Miloslav Trmač 2008-01-02 03:36:37 EST
llseek() does not make sense on a 64-bit platform.

You should use the system call functions provided by glibc; in this case, either
lseek64(), or just a plain lseek() (but note that on 32-bit platforms you'll
need to add preprocessor macros to make off_t 64-bit).
Comment 3 Shang Jie 2008-01-02 04:22:03 EST
This is what I just find:
$cd /usr/include
$ grep "__NR__" */*.h
asm-i386/unistd.h:#define __NR__llseek          140
asm-i386/unistd.h:#define __NR__newselect               142
asm-i386/unistd.h:#define __NR__sysctl          149
asm-x86_64/unistd.h:#define __NR__sysctl                           156
bits/syscall.h:#define SYS__sysctl __NR__sysctl
bits/syscall.h:#define SYS__llseek __NR__llseek
bits/syscall.h:#define SYS__newselect __NR__newselec

So, why the __NR__llseek just not defined on x86_64 architecture, and which
value I should take? Or I should just find a new method to inplase the
_syscall5. Any ideas?
Comment 4 Shang Jie 2008-01-02 04:27:21 EST
(In reply to comment #2)
> llseek() does not make sense on a 64-bit platform.
> 
> You should use the system call functions provided by glibc; in this case, either
> lseek64(), or just a plain lseek() (but note that on 32-bit platforms you'll
> need to add preprocessor macros to make off_t 64-bit).
I'm sorry that I haven't seen your reply.
Thank you! I'll have a try.


Note You need to log in before you can comment on or make changes to this bug.