1//! Documentation about unimplemented functions.
2//!
3//! This module contains documentation for several functions that rustix does
4//! not implement, either because they are out of scope, or because they are
5//! could probably be implemented but are not yet.
67macro_rules! not_implemented {
8 ($func:ident) => {
9/// See the [module comment](self).
10pub fn $func() {
11unimplemented!()
12 }
13 };
14}
1516/// Memory-allocation functions are out of scope for rustix.
17///
18/// It is possible to implement `malloc`, `free`, and similar functions in
19/// Rust, however rustix itself is focused on syscall-like functions. This
20/// module contains an incomplete list of such functions.
21///
22/// There are several allocator implementations for Rust; one of them is
23/// [dlmalloc]. For a rustix-based implementation, see [rustix-dlmalloc].
24/// Another allocator implementation is [talc].
25///
26/// [dlmalloc]: https://crates.io/crates/dlmalloc
27/// [talc]: https://crates.io/crates/talc
28/// [rustix-dlmalloc]: https://crates.io/crates/rustix-dlmalloc
29pub mod memory_allocation {
30not_implemented!(malloc);
31not_implemented!(realloc);
32not_implemented!(calloc);
33not_implemented!(free);
34not_implemented!(posix_memalign);
35not_implemented!(aligned_alloc);
36not_implemented!(malloc_usable_size);
37}
3839/// Functions which need access to libc internals are out of scope for rustix.
40///
41/// Most Rust programs have a libc present, and when a libc is present, it
42/// expects to be the only thing in the process that can do certain operations.
43/// For example, there can be only one `atexit` list in a process, only one
44/// `pthread_atfork` list in a process, only one implementation of pthreads in
45/// a process, and so on, and libc expects to own the one of each of those
46/// things. And libc implementations may expect to be involved in signal
47/// handling. So, these functions are believed to be out of scope for rustix.
48/// This module contains an incomplete list of such functions.
49///
50/// It would be possible to make a rust library which provides safe or
51/// ergonomic wrappers around these libc functions, however that is out of
52/// scope for rustix itself.
53///
54/// If you would like to write a Rust program which does not use a libc, and
55/// which does provide APIs for some of these functions, [Eyra] and [origin]
56/// are two libraries which may be useful, and which provide public interfaces
57/// for some of this functionality.
58///
59/// If you are otherwise writing Rust code which you know will not share a
60/// process with a libc, perhaps because you are writing a libc or similar
61/// yourself, rustix's codebase does include experimental implementations of
62/// the primitives needed to implement most of these functions.
63///
64/// [Eyra]: https://github.com/sunfishcode/eyra?tab=readme-ov-file#eyra
65/// [origin]: https://github.com/sunfishcode/origin?tab=readme-ov-file#origin
66pub mod libc_internals {
67not_implemented!(exit);
68not_implemented!(fork);
69not_implemented!(brk);
70not_implemented!(sigaction);
71not_implemented!(sigaltstack);
72not_implemented!(sigprocmask);
73not_implemented!(sigwait);
74not_implemented!(sigwaitinfo);
75not_implemented!(sigtimedwait);
76not_implemented!(set_thread_area);
77not_implemented!(set_tid_address);
78not_implemented!(tkill);
79not_implemented!(sched_setscheduler);
80not_implemented!(rseq);
81not_implemented!(setuid);
82not_implemented!(setgid);
83not_implemented!(seteuid);
84not_implemented!(setegid);
85not_implemented!(setreuid);
86not_implemented!(setregid);
87not_implemented!(setresuid);
88not_implemented!(setresgid);
89not_implemented!(setgroups);
9091not_implemented!(pthread_atfork);
92not_implemented!(pthread_attr_destroy);
93not_implemented!(pthread_attr_getaffinity_np);
94not_implemented!(pthread_attr_getdetachstate);
95not_implemented!(pthread_attr_getguardsize);
96not_implemented!(pthread_attr_getinheritsched);
97not_implemented!(pthread_attr_getschedparam);
98not_implemented!(pthread_attr_getschedpolicy);
99not_implemented!(pthread_attr_getscope);
100not_implemented!(pthread_attr_getsigmask_np);
101not_implemented!(pthread_attr_getstack);
102not_implemented!(pthread_attr_getstackaddr);
103not_implemented!(pthread_attr_getstacksize);
104not_implemented!(pthread_attr_init);
105not_implemented!(pthread_attr_setaffinity_np);
106not_implemented!(pthread_attr_setdetachstate);
107not_implemented!(pthread_attr_setguardsize);
108not_implemented!(pthread_attr_setinheritsched);
109not_implemented!(pthread_attr_setschedparam);
110not_implemented!(pthread_attr_setschedpolicy);
111not_implemented!(pthread_attr_setscope);
112not_implemented!(pthread_attr_setsigmask_np);
113not_implemented!(pthread_attr_setstack);
114not_implemented!(pthread_attr_setstackaddr);
115not_implemented!(pthread_attr_setstacksize);
116not_implemented!(pthread_barrierattr_destroy);
117not_implemented!(pthread_barrierattr_getpshared);
118not_implemented!(pthread_barrierattr_init);
119not_implemented!(pthread_barrierattr_setpshared);
120not_implemented!(pthread_barrier_destroy);
121not_implemented!(pthread_barrier_wait);
122not_implemented!(pthread_cancel);
123not_implemented!(pthread_cleanup_pop);
124not_implemented!(pthread_cleanup_pop_restore_np);
125not_implemented!(pthread_cleanup_push);
126not_implemented!(pthread_cleanup_push_defer_np);
127not_implemented!(pthread_condattr_destroy);
128not_implemented!(pthread_condattr_getclock);
129not_implemented!(pthread_condattr_getpshared);
130not_implemented!(pthread_condattr_init);
131not_implemented!(pthread_condattr_setclock);
132not_implemented!(pthread_condattr_setpshared);
133not_implemented!(pthread_cond_broadcast);
134not_implemented!(pthread_cond_destroy);
135not_implemented!(pthread_cond_signal);
136not_implemented!(pthread_cond_timedwait);
137not_implemented!(pthread_create);
138not_implemented!(pthread_detach);
139not_implemented!(pthread_equal);
140not_implemented!(pthread_exit);
141not_implemented!(pthread_getaffinity_np);
142not_implemented!(pthread_getattr_default_np);
143not_implemented!(pthread_getattr_np);
144not_implemented!(pthread_getconcurrency);
145not_implemented!(pthread_getcpuclockid);
146not_implemented!(pthread_getname_np);
147not_implemented!(pthread_getschedparam);
148not_implemented!(pthread_getspecific);
149not_implemented!(pthread_join);
150not_implemented!(pthread_key_create);
151not_implemented!(pthread_key_delete);
152not_implemented!(pthread_kill);
153not_implemented!(pthread_kill_other_threads_np);
154not_implemented!(pthread_mutexattr_destroy);
155not_implemented!(pthread_mutexattr_getprioceiling);
156not_implemented!(pthread_mutexattr_getprotocol);
157not_implemented!(pthread_mutexattr_getpshared);
158not_implemented!(pthread_mutexattr_getrobust);
159not_implemented!(pthread_mutexattr_getrobust_np);
160not_implemented!(pthread_mutexattr_gettype);
161not_implemented!(pthread_mutexattr_init);
162not_implemented!(pthread_mutexattr_setprioceiling);
163not_implemented!(pthread_mutexattr_setprotocol);
164not_implemented!(pthread_mutexattr_setpshared);
165not_implemented!(pthread_mutexattr_setrobust);
166not_implemented!(pthread_mutexattr_setrobust_np);
167not_implemented!(pthread_mutexattr_settype);
168not_implemented!(pthread_mutex_consistent);
169not_implemented!(pthread_mutex_consistent_np);
170not_implemented!(pthread_mutex_destroy);
171not_implemented!(pthread_mutex_getprioceiling);
172not_implemented!(pthread_mutex_init);
173not_implemented!(pthread_mutex_lock);
174not_implemented!(pthread_mutex_setprioceiling);
175not_implemented!(pthread_mutex_timedlock);
176not_implemented!(pthread_mutex_trylock);
177not_implemented!(pthread_once);
178not_implemented!(pthread_rwlockattr_destroy);
179not_implemented!(pthread_rwlockattr_getkind_np);
180not_implemented!(pthread_rwlockattr_getpshared);
181not_implemented!(pthread_rwlockattr_init);
182not_implemented!(pthread_rwlockattr_setkind_np);
183not_implemented!(pthread_rwlockattr_setpshared);
184not_implemented!(pthread_rwlock_destroy);
185not_implemented!(pthread_rwlock_rdlock);
186not_implemented!(pthread_rwlock_timedrdlock);
187not_implemented!(pthread_rwlock_timedwrlock);
188not_implemented!(pthread_rwlock_tryrdlock);
189not_implemented!(pthread_rwlock_trywrlock);
190not_implemented!(pthread_rwlock_unlock);
191not_implemented!(pthread_rwlock_wrlock);
192not_implemented!(pthread_self);
193not_implemented!(pthread_setaffinity_np);
194not_implemented!(pthread_setattr_default_np);
195not_implemented!(pthread_setcancelstate);
196not_implemented!(pthread_setcanceltype);
197not_implemented!(pthread_setconcurrency);
198not_implemented!(pthread_setname_np);
199not_implemented!(pthread_setschedparam);
200not_implemented!(pthread_setschedprio);
201not_implemented!(pthread_setspecific);
202not_implemented!(pthread_sigmask);
203not_implemented!(pthread_sigqueue);
204not_implemented!(pthread_spin_destroy);
205not_implemented!(pthread_spin_init);
206not_implemented!(pthread_spin_lock);
207not_implemented!(pthread_spin_trylock);
208not_implemented!(pthread_spin_unlock);
209not_implemented!(pthread_testcancel);
210not_implemented!(pthread_timedjoin_np);
211not_implemented!(pthread_tryjoin_np);
212not_implemented!(pthread_yield);
213}
214215/// Functions which provide higher-level functionality are out of scope for
216/// rustix.
217///
218/// These functions are provided by typical libc implementations, but are
219/// higher-level than the simple syscall-like functions that rustix focuses on.
220/// They could be implemented as a separate library built on top of rustix,
221/// rather than being part of rustix itself. This module contains an incomplete
222/// list of such functions.
223pub mod higher_level {
224not_implemented!(getpwent);
225not_implemented!(getpwuid);
226not_implemented!(getpwnam);
227not_implemented!(getpwuid_r);
228not_implemented!(getpwnam_r);
229not_implemented!(gethostbyname);
230not_implemented!(execv);
231not_implemented!(execvp);
232not_implemented!(execvpe);
233not_implemented!(wordexp);
234235/// See [rustix-openpty](https://crates.io/crates/rustix-openpty).
236pub fn closefrom() {
237unimplemented!()
238 }
239/// See [rustix-openpty](https://crates.io/crates/rustix-openpty).
240pub fn login_tty() {
241unimplemented!()
242 }
243/// See [rustix-openpty](https://crates.io/crates/rustix-openpty).
244pub fn openpty() {
245unimplemented!()
246 }
247248/// See [`std::io::IsTerminal`].
249 ///
250 /// For Rust < 1.70, see [is-terminal]. For a rustix-based implementation,
251 /// see [rustix-is-terminal].
252 ///
253 /// [`std::io::IsTerminal`]: std::io::IsTerminal
254 /// [is-terminal]: https://crates.io/crates/is-terminal
255 /// [rustix-is-terminal]: https://crates.io/crates/rustix-is-terminal
256pub fn isatty() {
257unimplemented!()
258 }
259}
260261/// These functions are not yet implemented in rustix, but probably could be.
262///
263/// These are functions that users have asked about, and which probably are in
264/// scope for rustix, but are not yet implemented. This module contains an
265/// incomplete list of such functions.
266pub mod yet {
267not_implemented!(tgkill);
268not_implemented!(raise);
269not_implemented!(sysctl);
270not_implemented!(mq_open);
271not_implemented!(mq_send);
272not_implemented!(mq_unlink);
273not_implemented!(recvmmsg);
274not_implemented!(cachestat);
275not_implemented!(fanotify_init);
276not_implemented!(fanotify_mark);
277not_implemented!(getifaddrs);
278not_implemented!(signalfd);
279not_implemented!(pidfd_send_signal);
280not_implemented!(mount_setattr);
281not_implemented!(extattr_delete_fd);
282not_implemented!(extattr_delete_link);
283not_implemented!(extattr_get_fd);
284not_implemented!(extattr_get_link);
285not_implemented!(extattr_list_fd);
286not_implemented!(extattr_list_link);
287not_implemented!(extattr_set_fd);
288not_implemented!(extattr_set_link);
289not_implemented!(get_mempolicy);
290not_implemented!(mbind);
291not_implemented!(set_mempolicy);
292not_implemented!(migrate_pages);
293not_implemented!(move_pages);
294not_implemented!(fchmodat2);
295not_implemented!(shmat);
296not_implemented!(shmdt);
297not_implemented!(shmget);
298not_implemented!(shmctl);
299}
300301/// These functions are not quite yet finished in rustix.
302///
303/// Rustix's codebase includes experimental implementations of these functions,
304/// however they are not yet publicly exposed because their API might need more
305/// work and/or they don't yet have a libc backend implementation yet.
306///
307/// See [#1314] for more information, and please leave comments if there are
308/// specific functions you're interested in.
309///
310/// [#1314]: https://github.com/bytecodealliance/rustix/issues/1314
311pub mod quite_yet {
312not_implemented!(_exit);
313not_implemented!(_Exit);
314not_implemented!(exit_group);
315not_implemented!(sigpending);
316not_implemented!(sigsuspend);
317not_implemented!(execveat);
318not_implemented!(execve);
319320/// For now, use `rustix::process::uname().nodename()` instead.
321 ///
322 /// See also the [module comment](self).
323pub fn gethostname() {
324unimplemented!()
325 }
326}