Opened 7 years ago

Closed 7 years ago

#9337 closed bug (fixed)

Implement ftw.h

Reported by: vibhavp Owned by: nobody
Priority: normal Milestone: R1
Component: - General Version: R1/alpha4.1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

It would be nice to have ftw.h support in haiku: http://pubs.opengroup.org/onlinepubs/7908799/xsh/ftw.h.html

Attachments (2)

ftw_fts.patch (55.9 KB) - added by landonf 7 years ago.
ftw(3), nftw(3), and fts(3) implementation
ftw_fts-2.patch (56.9 KB) - added by landonf 7 years ago.

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by landonf

Attachment: ftw_fts.patch added

ftw(3), nftw(3), and fts(3) implementation

comment:1 Changed 7 years ago by landonf

Has a Patch: set

comment:2 Changed 7 years ago by landonf

I was working on some portable code that required fts(3) directory traversal on Haiku, so I went ahead and integrated this. The patch is a direct port of FreeBSD's fts(3) (defacto standard), on top of which the POSIX ftw(3) and nftw(3) functions are implemented.

comment:3 Changed 7 years ago by korli

Why removing the flag FTS_WHITEOUT?

BTW I'm unsure we drop BSD headers (even POSIX) in headers/posix/

comment:4 Changed 7 years ago by landonf

Thanks for reviewing!

Why removing the flag FTS_WHITEOUT?

AFAIK it's FreeBSD-specific (eg, unionfs) and not supported anywhere else. Do you want me to leave the flag defined and just disable the FreeBSD-specific whiteout code? I believe that would match glibc's approach.

BTW I'm unsure we drop BSD headers (even POSIX) in headers/posix/

I wasn't sure about the correct directory, but it seemed in good company. Happy to move it there's a preferred location.

comment:5 in reply to:  4 Changed 7 years ago by korli

Replying to landonf:

AFAIK it's FreeBSD-specific (eg, unionfs) and not supported anywhere else. Do you want me to leave the flag defined and just disable the FreeBSD-specific whiteout code? I believe that would match glibc's approach.

No, just not defining FTS_WHITEOUT with a __HAIKU__ check would be fine.

I wasn't sure about the correct directory, but it seemed in good company. Happy to move it there's a preferred location.

Sure. It could be rewritten later anyway.

Changed 7 years ago by landonf

Attachment: ftw_fts-2.patch added

comment:6 Changed 7 years ago by landonf

Great, updated patch attached with FTS_WHITEOUT changes.

comment:7 Changed 7 years ago by korli

Resolution: fixed
Status: newclosed

Thanks, applied in hrev45148!

Note: See TracTickets for help on using tickets.