git: libc: Change dirfd() into a function (needed per POSIX).

Sascha Wildner swildner at crater.dragonflybsd.org
Sat Jan 24 07:29:54 PST 2015


commit de45303d1431339260c3a353a1e18d034c807c4a
Author: Sascha Wildner <saw at online.de>
Date:   Sat Jan 24 14:15:08 2015 +0100

    libc: Change dirfd() into a function (needed per POSIX).
    
    At the same time, make struct _dirdesc private to libc. If access
    to dd_fd is needed, dirfd() has to be used. Inside libc, the former
    dirfd() macro is preserved as _dirfd().
    
    Also, in struct _dirdesc, change the lock from "void *" to
    "struct pthread_mutex *". This allows us to eliminate some casts
    in readdir() and friends.
    
    Our documentation already describes dirfd() as a function.
    
    Based-on: FreeBSD's similar work

Summary of changes:
 include/dirent.h                                   | 18 ++--------
 lib/libc/gen/Makefile.inc                          |  2 +-
 lib/libc/gen/Symbol.map                            |  1 +
 lib/libc/gen/closedir.c                            |  8 ++---
 .../cd9660_iconv.c => lib/libc/gen/dirfd.c         | 21 ++++++++----
 .../m4/pathnames.h => lib/libc/gen/gen_private.h   | 40 +++++++++++++++-------
 lib/libc/gen/opendir.c                             |  1 +
 lib/libc/gen/readdir.c                             | 10 +++---
 lib/libc/gen/rewinddir.c                           |  3 +-
 lib/libc/gen/scandir.c                             |  2 ++
 lib/libc/gen/seekdir.c                             |  5 +--
 lib/libc/gen/telldir.c                             |  6 ++--
 12 files changed, 66 insertions(+), 51 deletions(-)
 copy sys/vfs/isofs/cd9660/cd9660_iconv/cd9660_iconv.c => lib/libc/gen/dirfd.c (83%)
 copy usr.bin/m4/pathnames.h => lib/libc/gen/gen_private.h (64%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/de45303d1431339260c3a353a1e18d034c807c4a


-- 
DragonFly BSD source repository


More information about the Commits mailing list