[cups.bugs] [HIGH] STR #2001: Use of readdir_r() incorrect on Solaris and HP-UX 10.20

The Written Word bugs-cups at thewrittenword.com
Sun Oct 1 22:17:26 PDT 2006


[STR New]

>From Solaris readdir(3C):
  Standard conforming
     cc [ flag ... ] file ... -D_POSIX_PTHREAD_SEMANTICS [ library ... ]

     int readdir_r(DIR *restrict dirp,  struct  dirent  *restrict
     entry, struct dirent **restrict result);

>From HP-UX 10.20 directory(3C):
      int readdir_r(DIR *dirp, struct dirent *result);

On Solaris, because cups/dir.c is not compiled with
-D_POSIX_PTHREAD_SEMANTICS, cupsDirRead() doesn't work correctly. On HP-UX
10.20, because -D_REENTRANT is not used, the prototype for readdir_r is
not used from <sys/dirent.h> and the 3arg version is used while HP-UX
10.20 only has a 2arg version.

Patch attached to determine if -D_POSIX_PTHREAD_SEMANTICS is needed for a
working readdir_r and if readdir_r takes 2 arguments (if not, assumes it
takes 3).

Link: http://www.cups.org/str.php?L2001
Version: 1.2.4
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: readdir_r.patch
URL: <https://lists.cups.org/pipermail/cups/attachments/20061002/dae7109c/attachment.ksh>


More information about the cups mailing list