Page MenuHomeFreeBSD

libsys: don't expose sigwait wrapper
ClosedPublic

Authored by brooks on Mar 5 2024, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 4, 5:37 PM
Unknown Object (File)
Mon, Dec 2, 9:22 PM
Unknown Object (File)
Fri, Nov 22, 7:21 AM
Unknown Object (File)
Wed, Nov 13, 11:38 PM
Unknown Object (File)
Tue, Nov 12, 10:15 AM
Unknown Object (File)
Tue, Nov 12, 9:48 AM
Unknown Object (File)
Oct 21 2024, 9:38 PM
Unknown Object (File)
Oct 21 2024, 9:38 PM
Subscribers

Details

Summary

Long ago (e129c18a83ef) sys_sigwait was wrapped to prevent sigwait()
from returning with EINTR. Through a series of changes this wrapper
become
libc_sigwait which was internal to libc and used solely in the
interposing table. To support a move of sigwait back to libc, move this
wrapper into interposing_table and rename it with an __libsys_ prefix.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks requested review of this revision.Mar 5 2024, 9:49 PM

There might be something to be said for putting libsys_sigwait in its own file. Alternatively we could also kill off sigwait and make it static instead.

Ok, but why moving the code into the interposer's file? I would see adding e.g. libc_sigwait.c source with the EINTR loop function. Or keeping the function in its current place.

Add a libsys_sigwait that implements __libsys_sigwait. I think we
might be able to move it back to libc and the libc interposer table,
but without further testing I'm worried about breaking things during
upgrades so I think this split makes sense for now.

lib/libsys/interposing_table.c
32

This addition is not needed.

35

Why not keep the prototype in libc_private.h?

lib/libsys/libsys_sigwait.c
30

Headers are already ordered alphabetically.

kib added inline comments.
lib/libc/include/libc_private.h
418

No need to use __restrict, libc is always compiled by mode where restrict is valid.

This revision is now accepted and ready to land.Mar 12 2024, 11:59 PM
This revision was automatically updated to reflect the committed changes.