@@ -85,13 +85,25 @@ pub unsafe fn arm_set_tls(data: *mut c_void) -> io::Result<()> {
85
85
backend:: runtime:: syscalls:: tls:: arm_set_tls ( data)
86
86
}
87
87
88
+ /// `prctl(PR_SET_FS, data)`—Set the x86_64 `fs` register.
89
+ ///
90
+ /// # Safety
91
+ ///
92
+ /// This is a very low-level feature for implementing threading libraries.
93
+ /// See the references links above.
88
94
#[ cfg( linux_raw) ]
89
95
#[ cfg( target_arch = "x86_64" ) ]
90
96
#[ inline]
91
97
pub unsafe fn set_fs ( data : * mut c_void ) {
92
98
backend:: runtime:: syscalls:: tls:: set_fs ( data)
93
99
}
94
100
101
+ /// Set the x86_64 thread ID address.
102
+ ///
103
+ /// # Safety
104
+ ///
105
+ /// This is a very low-level feature for implementing threading libraries.
106
+ /// See the references links above.
95
107
#[ cfg( linux_raw) ]
96
108
#[ inline]
97
109
pub unsafe fn set_tid_address ( data : * mut c_void ) -> Pid {
@@ -384,36 +396,54 @@ pub unsafe fn sigprocmask(how: How, set: Option<&Sigset>) -> io::Result<Sigset>
384
396
385
397
/// `sigwait(set)`—Wait for signals.
386
398
///
399
+ /// # Safety
400
+ ///
401
+ /// If code elsewhere in the process is depending on delivery of a signal to
402
+ /// prevent it from executing some code, this could cause it to miss that
403
+ /// signal and execute that code.
404
+ ///
387
405
/// # References
388
406
/// - [Linux]
389
407
///
390
408
/// [Linux]: https://man7.org/linux/man-pages/man3/sigwait.3.html
391
409
#[ cfg( linux_raw) ]
392
410
#[ inline]
393
- pub fn sigwait ( set : & Sigset ) -> io:: Result < Signal > {
411
+ pub unsafe fn sigwait ( set : & Sigset ) -> io:: Result < Signal > {
394
412
backend:: runtime:: syscalls:: sigwait ( set)
395
413
}
396
414
397
415
/// `sigwait(set)`—Wait for signals, returning a [`Siginfo`].
398
416
///
417
+ /// # Safety
418
+ ///
419
+ /// If code elsewhere in the process is depending on delivery of a signal to
420
+ /// prevent it from executing some code, this could cause it to miss that
421
+ /// signal and execute that code.
422
+ ///
399
423
/// # References
400
424
/// - [Linux]
401
425
///
402
426
/// [Linux]: https://man7.org/linux/man-pages/man2/sigwaitinfo.2.html
403
427
#[ cfg( linux_raw) ]
404
428
#[ inline]
405
- pub fn sigwaitinfo ( set : & Sigset ) -> io:: Result < Siginfo > {
429
+ pub unsafe fn sigwaitinfo ( set : & Sigset ) -> io:: Result < Siginfo > {
406
430
backend:: runtime:: syscalls:: sigwaitinfo ( set)
407
431
}
408
432
409
433
/// `sigtimedwait(set)`—Wait for signals, optionally with a timeout.
410
434
///
435
+ /// # Safety
436
+ ///
437
+ /// If code elsewhere in the process is depending on delivery of a signal to
438
+ /// prevent it from executing some code, this could cause it to miss that
439
+ /// signal and execute that code.
440
+ ///
411
441
/// # References
412
442
/// - [Linux]
413
443
///
414
444
/// [Linux]: https://man7.org/linux/man-pages/man2/sigtimedwait.2.html
415
445
#[ cfg( linux_raw) ]
416
446
#[ inline]
417
- pub fn sigtimedwait ( set : & Sigset , timeout : Option < Timespec > ) -> io:: Result < Siginfo > {
447
+ pub unsafe fn sigtimedwait ( set : & Sigset , timeout : Option < Timespec > ) -> io:: Result < Siginfo > {
418
448
backend:: runtime:: syscalls:: sigtimedwait ( set, timeout)
419
449
}
0 commit comments