Page MenuHomeFreeBSD

build: Add legacy support for futimens() and utimensat().
ClosedPublic

Authored by jilles on Jun 7 2016, 10:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 22 2025, 1:01 PM
Unknown Object (File)
Nov 21 2025, 10:54 AM
Unknown Object (File)
Nov 21 2025, 10:54 AM
Unknown Object (File)
Nov 21 2025, 10:53 AM
Unknown Object (File)
Nov 21 2025, 10:52 AM
Unknown Object (File)
Nov 18 2025, 6:59 AM
Unknown Object (File)
Nov 10 2025, 5:10 PM
Unknown Object (File)
Oct 27 2025, 4:49 PM
Subscribers

Details

Reviewers
bdrewery
Summary

In order to allow using utimensat() in install(1), add futimens() and
utimensat() to -legacy.

To simplify the code, no includes are installed for this. These functions
are declared in <sys/stat.h> and installing a header file to sys/ requires
additional make magic. The compilation flags are such that this will build
and the functions return int and are called with correct parameter types
and without using UTIME_OMIT and UTIME_NOW in install(1), so this should be
OK.

Test Plan

Revert rS299942 (which is a revert of rS299850) enabling nanosecond timestamps in install(1) and
make -j4 buildworld on recent stable/10 and in a chroot with releng/10.2.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jilles retitled this revision from to build: Add legacy support for futimens() and utimensat()..
jilles updated this object.
jilles edited the test plan for this revision. (Show Details)
jilles added a reviewer: bdrewery.
jilles set the repository for this revision to rS FreeBSD src repository - subversion.
jilles added a subscriber: bapt.

You should be able to use the existing source files in the tree.
(SRCTOP is a simpler version of .CURDIR/../../)

.PATH ${SRCTOP}/lib/libc/sys
CFLAGS+= -I${SRCTOP}/lib/libc/include

Then it will pull the existing futimens.c and utimensat.c from lib/libc/sys.

For installing sys/stat you can use something like this: https://people.freebsd.org/~bdrewery/patches/legacy-sys-example.diff

jilles edited edge metadata.
jilles removed rS FreeBSD src repository - subversion as the repository for this revision.

New patch with proper header file installation (thanks for the example).

I'm leaving futimens.c and utimensat.c as modified copies of the files under lib/libc/sys/ since the libc versions use symbols that do not exist in the libc on the build system (sys_futimens and sys_utimensat) . I expect the next non-sweeping change to both sets of files to be to delete them, anyway.

bdrewery edited edge metadata.
This revision is now accepted and ready to land.Jun 9 2016, 3:33 PM