Menu

#7 readlink returns ssize_t, not int, post glibc-2.4

open
nobody
None
5
2007-07-04
2007-07-04
No

g++ -g -O2 -Wall -Ilib -c lib/readlink.cc -fPIC -DPIC -o lib/.libs/readlink.o
lib/readlink.cc: In function `int readlink(const char*, char*, size_t)':
lib/readlink.cc:32: error: declaration of C function `int readlink(const char*, char*, size_t)' conflicts with
/usr/include/gentoo-multilib/amd64/unistd.h:775: error: previous declaration `ssize_t readlink(const char*, char*, size_t)' here

From the readlink(2) man page:

HISTORY
In versions of glibc up to and including glibc 2.4, the return type of readlink() was declared as int. Nowadays, the return type is declared as ssize_t, as (newly) required in POSIX.1-2001.

Discussion

  • Charles Duffy

    Charles Duffy - 2007-07-04

    Logged In: YES
    user_id=44367
    Originator: YES

    It's trivial -- but hey, I've got a patch, might as well attach it.
    File Added: plasticfs-readlink.patch

     
  • Charles Duffy

    Charles Duffy - 2007-07-04
     
Monday.com Logo