From 0afb8a1b494ba36c5effd3430240b8e9439076c7 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 9 Jun 2022 16:30:40 -0400 Subject: [PATCH] Move fts.h and functions from libroot to libbsd. These are BSD extensions, not POSIX functions. They were needed in libroot by the previous versions of the ftw/nftw implementations, but the musl versions do not need them, and so we can move them to libbsd. This is a minor ABI break, but hopefully whatever was using them in libroot also links to libbsd. If not, that's an easy enough fix. (These were only added to libroot in 2013.) --- headers/{posix => compatibility/bsd}/fts.h | 6 ++++++ src/libs/bsd/Jamfile | 1 + src/{system/libroot/posix => libs/bsd}/fts.c | 0 src/system/libroot/posix/Jamfile | 1 - 4 files changed, 7 insertions(+), 1 deletion(-) rename headers/{posix => compatibility/bsd}/fts.h (98%) rename src/{system/libroot/posix => libs/bsd}/fts.c (100%) diff --git a/headers/posix/fts.h b/headers/compatibility/bsd/fts.h similarity index 98% rename from headers/posix/fts.h rename to headers/compatibility/bsd/fts.h index 2f3780b715..1b7467740e 100644 --- a/headers/posix/fts.h +++ b/headers/compatibility/bsd/fts.h @@ -33,6 +33,10 @@ #ifndef _FTS_H_ #define _FTS_H_ +#include + +#ifdef _DEFAULT_SOURCE + #include typedef struct { @@ -135,4 +139,6 @@ int fts_set(FTS *, FTSENT *, int); void fts_set_clientptr(FTS *, void *); __END_DECLS +#endif /* _DEFAULT_SOURCE */ + #endif /* !_FTS_H_ */ diff --git a/src/libs/bsd/Jamfile b/src/libs/bsd/Jamfile index 0b3c70d046..3f22999240 100644 --- a/src/libs/bsd/Jamfile +++ b/src/libs/bsd/Jamfile @@ -13,6 +13,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { err.c explicit_bzero.c fgetln.c + fts.c getpass.c issetugid.c lutimes.c diff --git a/src/system/libroot/posix/fts.c b/src/libs/bsd/fts.c similarity index 100% rename from src/system/libroot/posix/fts.c rename to src/libs/bsd/fts.c diff --git a/src/system/libroot/posix/Jamfile b/src/system/libroot/posix/Jamfile index c8322d107b..3271dce2c5 100644 --- a/src/system/libroot/posix/Jamfile +++ b/src/system/libroot/posix/Jamfile @@ -32,7 +32,6 @@ for architectureObject in [ MultiArchSubDirSetup ] { dirent.c errno.c fcntl.cpp - fts.c glob.c inttypes.c libgen.cpp