rust/library/std/src/sys/unix
Dylan DPC 0e8f0b03cd
Rollup merge of #106001 - sdroege:glibc-skip-over-null-argv, r=ChrisDenton
Stop at the first `NULL` argument when iterating `argv`

Some C commandline parsers (e.g. GLib and Qt) are replacing already handled arguments in `argv` with `NULL` and move them to the end. That means that `argc` might be bigger than the actual number of non-`NULL` pointers in `argv` at this point.

To handle this we simply stop iterating at the first `NULL` argument.

`argv` is also guaranteed to be `NULL`-terminated so any non-`NULL` arguments after the first `NULL` can safely be ignored.

Fixes https://github.com/rust-lang/rust/issues/105999
2023-02-11 11:15:54 +05:30
..
fd I/O safety. 2021-08-19 12:02:39 -07:00
kernel_copy add test for failing io::copy specialization 2021-02-22 21:41:32 +01:00
locks std: cleanup timeouts in pthread condvar 2022-12-02 14:38:20 +01:00
os Refactor weak symbols in std::sys::unix 2021-11-12 15:25:16 -08:00
os_str Expose Utf8Lossy as Utf8Chunks 2022-08-20 12:49:20 -04:00
process signal update string representation for haiku. 2023-01-18 23:06:59 +00:00
thread_parking std: remove unnecessary #[cfg] on NetBSD 2022-12-30 15:50:31 +01:00
alloc.rs Horizon OS STD support 2022-06-13 20:44:39 -07:00
android.rs Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00
args.rs Stop at the first NULL argument when iterating argv 2022-12-23 09:34:22 +02:00
cmath.rs Reuse unix::cmath 2021-04-28 14:25:04 +02:00
env.rs Library changes for Apple WatchOS 2022-07-20 08:57:36 +01:00
fd.rs Address reviewer comments 2022-08-18 10:34:40 +01:00
fs.rs Rollup merge of #106860 - anden3:doc-double-spaces, r=Dylan-DPC 2023-01-14 18:45:29 +01:00
futex.rs std: panic instead of deadlocking in mutex implementation on Fuchsia 2022-07-18 10:56:10 +02:00
io.rs Add IsTerminal trait to determine if a descriptor or handle is a terminal 2022-10-15 00:35:38 +01:00
kernel_copy.rs Remove various double spaces in source comments. 2023-01-14 17:22:04 +01:00
l4re.rs Use Rust 2021 prelude in std itself. 2022-05-09 11:12:32 +02:00
memchr.rs mark FIXMES for all the places found that are probably offset_from 2022-03-29 20:18:28 -04:00
mod.rs Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se 2022-12-30 21:26:33 -08:00
net.rs Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
os_str.rs Expose Utf8Lossy as Utf8Chunks 2022-08-20 12:49:20 -04:00
os.rs Reduce CString allocations in std as much as possible 2022-10-03 11:13:17 -07:00
path.rs Unix path::absolute: Fix leading "." component 2022-03-05 17:57:12 +00:00
pipe.rs Add read_to_end for AnonPipe 2022-12-08 18:12:15 +05:30
rand.rs Revert "Use getentropy when possible on all Apple platforms" 2022-10-05 00:48:22 -05:00
stack_overflow.rs std: only use LFS function on glibc 2022-12-22 16:01:27 +08:00
stdio.rs Consolidate AsFd instances for stdio types into library/std/src/os/fd/owned.rs 2022-10-10 14:47:22 +01:00
thread_local_dtor.rs Rollup merge of #106779 - RReverser:patch-2, r=Mark-Simulacrum 2023-01-26 07:53:22 +01:00
thread_local_key.rs std: optimize TLS on Windows 2022-10-08 20:19:21 +02:00
thread.rs refactor[std]: do not use box syntax 2023-01-17 14:08:35 +01:00
time.rs std: cleanup timeouts in pthread condvar 2022-12-02 14:38:20 +01:00
weak.rs Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00