summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* ctime.3: SYNOPSIS: Mark [as]ctime[_r]() as [[deprecated]]synopsisAlejandro Colomar2022-09-05-8/+14
| | | | | | | | | | | C2X is going to deprecate these functions, as POSIX.1-2008 already did. Move them to the bottom of the synopsis, to show non-deprecated functions first. Reported-by: Joseph Myers <joseph@codesourcery.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* ctime.3, strftime.3, strptime.3, timegm.3: SYNOPSIS: Add [[gnu::nonnull]] to ↵Alejandro Colomar2022-09-05-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <time.h> prototypes A proposal for C2X proposed changing the prototypes of <time.h> functions that accept a pointer that cannot be NULL, to use 'static', which clearly denotes that passing NULL is Undefined Behavior. For example, 'time_t mktime(struct tm tm[static 1]);'. This change is backwards compatible, since array notation is just syntactic sugar for pointers, and the Undefined Behavior in case of a pointer already existed (in the wording); it just wasn't clear from the prototype itself. This proposal was finally not merged into the standard, as Jens noted. But it points out a defficiency in the current prototype. However, that proposal used of VLA (array) notation for something that is *not* an array. It is cofusing, probably too much for some programmers not so familiar with the difference between an array and a pointer, and that happens more than we would like. Even for programmers that clearly know the difference between an array and a pointer, this is at least misleading. That happens because the standard lacks a 'nonnull' attribute, and only has that (VLA) way of expressing what GCC can express with '[[gnu::nonnull]]' (a.k.a. '__attribute__((__nonnull__))'). Expressing that NULL pointers shall invoke Undefined Behavior in the prototype of a function is *way* more readable than having to read through the whole manual page text, so ideally we should also follow the idea of expressing that. But we can make use of more advanced techniques such as the GCC attribute, which help keep the information that those pointers are actually pointers and not arrays. From the 2 different attribute notations, let's use the "C++" one, which will be part of the standard in C2X (unlike __attribute__), and is also shorter, which helps keep the SYNOPSIS short (mostly one-liner prototypes). See <http://www.open-std.org/JTC1/SC22/WG14/www/docs/n2417.pdf> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Cc: Jens Gustedt <jens.gustedt@loria.fr> Cc: Glibc <libc-alpha@sourceware.org>
* utime.2: SYNOPSIS: Mark utime() as [[deprecated]]Alejandro Colomar2022-09-05-0/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* setpgid.2: SYNOPSIS: Mark POSIX setpgrp() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* getpw.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | This function is insecure. Use getpwuid(3). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* matherr.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-2/+2
| | | | | | This is no longer supported by glibc. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* __setfpucw.3: SYNOPSIS: Mark __setfpucw() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | The function doesn't exist anymore. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* ftw.3: SYNOPSIS: Mark ftw() as [[deprecated]]Alejandro Colomar2022-09-05-0/+1
| | | | | | | Use nftw(3) instead. ftw(3) has issues with [sig]longjmp(3). Link: <https://stackoverflow.com/q/19617783/6872717> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* ulimit.3: SYNOPSIS: Mark ulimit() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* ecvt.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-4/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* ecvt_r.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-10/+12
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* qecvt.3: SYNOPSIS: Mark q*cvt() as [[deprecated]]Alejandro Colomar2022-09-05-7/+5
| | | | | | Use snprintf(3) instead. Most Unix systems lack these functions. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* ctime.3: SYNOPSIS: Use VLA notation for [as]ctime_r() bufferAlejandro Colomar2022-09-05-2/+4
| | | | | | | | | | | | | | | | | As N2417 (a proposal for C2x that was not accepted) suggests. This syntax is very informative, and also, if used by library implementers, can improve static analysis. Since it is backwards compatible with pointer syntax, we can do this. Also, the reason for not being accepted, as Jens noted, was incompatibility with C++. But IMO, that's not something that we should care too much. Users of other languages should know what to expect when reading C code, and are expected to know C/C++ incompatibilities. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Cc: Jens Gustedt <jens.gustedt@loria.fr> Cc: Glibc <libc-alpha@sourceware.org>
* getpass.3: SYNOPSIS: Mark getpass() as [[deprecated]]Alejandro Colomar2022-09-05-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggest readpassphrase(3bsd) as an alternative. Some implementations of getpass(3) may suffer from the same issues that gets(3) suffers and some more. See the long discussion in the mailing list for more details (link at the bottom of this commit message). I'll quote some relevant parts here: Eugene Syromyatnikov <evgsyr@gmail.com>: { And the only mention of getpass() in POSIX (at least, since the 2001's edition) indeed seems to be [1], in the list of functions that have not been carried forward from XSH5, the 1997 revision of “System Interfaces and Headers” (that is, SUSv2)[2], where it is inherited from SUSv1[4] from XPG[5] and, as Alejandro already mentioned, marked as obsolete, per XPG3 to XPG4 migration guide[6]; the previous, 1988, version of POSIX[3] does not mention getpass() at all. [1] https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap01.html [2] https://pubs.opengroup.org/onlinepubs/7908799/xsh/getpass.html [3] https://mirror.math.princeton.edu/pub/oldlinux/download/c953.pdf [4] https://pubs.opengroup.org/onlinepubs/9695969499/toc.pdf [5] https://bitsavers.computerhistory.org/pdf/xOpen/X_Open_Portability_Guide_1985/xpg_2_xopen_system_v_specification_2.pdf [6] http://archive.opengroup.org/publications/archive/CDROM/g501.pdf } Theo de Raadt <deraadt@openbsd.org>: { The community finally had the balls to get rid of gets(3). getpass(3) shares the same flaw, that the buffer size isn't passed. This has been an issue in the past, and incorrectly led to readpassphrase(3). readpassphrase(3) has a few too many features/extensions for my taste, but at least it is harder to abuse. } Alejandro Colomar <alx.manpages@gmail.com>: { I found readpassphrase(3) in FreeBSD and OpenBSD. It is also present in libbsd(7), which is available in most Linux distributions. I also found it on a Mac that I have access. NetBSD has getpass_r(3) instead. It is not in any other system I have access. } Zack Weinberg <zack@owlfolio.org>: { I was about to post exactly the same thing. getpass(3) is not deprecated because there's a better replacement, it's deprecated because it's _unsafe_. The glibc implementation wraps getline(3) and therefore doesn't truncate the passphrase or overflow a fixed-size buffer, no matter how long the input is, but portable code cannot rely on that. And come to think of it, using getline(3) means that prefixes of the passphrase may be left lying around in malloc's free lists. (getpass also cannot be made thread safe, due to recycling of a static buffer, but a program in which multiple threads are racing to prompt the user for passwords would be a UX disaster anyway, so I don't think that's a critical flaw the way it is for e.g. strtok(3).) The Linux manpage project's documentation is, as I understand it, for Linux with glibc _first_, but not _only_; it should not describe this function as not-deprecated just because glibc has patched its worst problems and doesn't offer any better API. } List: <https://lore.kernel.org/linux-man/6d8642e9-71f7-4a83-9791-880d04f67d17@www.fastmail.com/T/#t> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Cc: Git <git@vger.kernel.org> Cc: Glibc <libc-alpha@sourceware.org> Cc: OpenBSD <tech@openbsd.org> Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Cc: Benoit Lecocq <benoit@openbsd.org> Cc: Klemens Nanni <kn@openbsd.org> Cc: Randall <rsbecker@nexbridge.com> Cc: Eugene Syromyatnikov <evgsyr@gmail.com> Cc: Theo de Raadt <deraadt@openbsd.org> Cc: Zack Weinberg <zack@owlfolio.org> Cc: Florian Weimer <libc-alpha@sourceware.org>
* gsignal.3: SYNOPSIS: Mark [gs]signal() as [[deprecated]]Alejandro Colomar2022-09-05-2/+2
| | | | | | They are obsolete in other systems, and broken in glibc. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* re_comp.3: SYNOPSIS: Mark these functions as [[deprecated]]Alejandro Colomar2022-09-05-2/+2
| | | | | | | They are MT unsafe, and replaced by the MT-safe POSIX regex(3) functions. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* rexec.3: SYNOPSIS: Mark rexec*() as [[deprecated]]Alejandro Colomar2022-09-05-0/+3
| | | | | | They are insecure, and replaced by rcmd(3). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* toascii.3: SYNOPSIS: Mark toascii() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | It cannot be used portably in a localized application. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* scalb.3: SYNOPSIS: Mark these functions as [[deprecated]]Alejandro Colomar2022-09-05-3/+3
| | | | | | Use scalbn(3) instead. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* getcwd.3: SYNOPSIS: Use VLA notation for getwd()'s argumentAlejandro Colomar2022-09-05-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* gethostbyname.3: Move non-deprecated functions to the topAlejandro Colomar2022-09-05-15/+15
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* gethostbyname.3: SYNOPSIS: Mark several symbols as [[deprecated]]Alejandro Colomar2022-09-05-6/+10
| | | | | | *hostent*() are the only ones that are not deprecated, AFAICS. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* bcmp.3: SYNOPSIS: Mark bcmp() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | Use memcmp(3) instead. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* gets.3: SYNOPSIS: Mark gets() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* resolver.3: SYNOPSIS: Use [[deprecated]] instead of a 'Deprecated' subsectionAlejandro Colomar2022-09-05-6/+8
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* perror.3: SYNOPSIS: Mark sys_errlist[] and sys_nerr as [[deprecated]]Alejandro Colomar2022-09-05-2/+3
| | | | | | They are no longer exposed by glibc. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* getcwd.3: SYNOPSIS: Mark getwd() as [[deprecated]]Alejandro Colomar2022-09-05-1/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* strsignal.3: SYNOPSIS: Mark sys_siglist[] as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* inet.3: SYNOPSIS: Mark inet_ntoa() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | See inet_ntop(3). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* strcpy.3: SYNOPSIS: Add missing 'restrict'Alejandro Colomar2022-09-05-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* pthread_mutexattr_setrobust.3: SYNOPSIS: Mark *_np() old functions as ↵Alejandro Colomar2022-09-05-0/+2
| | | | | | [[deprecated]] Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* readdir_r.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-2/+3
| | | | | | | | | | | | Glibc: dirent/dirent.h:183: extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __nonnull ((1, 2, 3)) __attribute_deprecated__; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* pthread_yield.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | | sched_yield(3) is identical and is in POSIX. See glibc commit c2fd60a5861efef48252f5cc7efc70e1d8a0da9a. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* getipnodebyname.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-5/+6
| | | | | | | These functions are not anymore in glibc. All other systems call them deprecated. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* gamma.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-3/+3
| | | | | | | These functions are misleading, and in some systems mean a different thing (tgamma(3) vs lgamma(3)). Never use gamma(3). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* bcopy.3: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | | | | memmove(3) completely replaces bcopy(3), being an almost identical function, except for the different order in the arguments. memmove(3) is part of ISO C and POSIX. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* uselib.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-4/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* sysfs.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-3/+3
| | | | | | Use proc(5) instead. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* setpgid.2: SYNOPSIS: Mark BSD versions of getpgrp() and setpgrp() as ↵Alejandro Colomar2022-09-05-4/+4
| | | | | | | | | [[deprecated]] The BSD version of getpgrp(2) was superseeded by the POSIX one. The BSD version of setpgrp(2) was superseeded by the POSIX one. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* futimesat.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-2/+2
| | | | | | Use utimensat(2) instead. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* sgetmask.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-7/+2
| | | | | | Use sigprocmask(2) instead. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* tkill.2: SYNOPSIS: Mark tkill() as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | tkill(2) has been superseeded by tgkill(2). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* sysctl.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | This syscall no longer exists! Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* pthread_mutex_consistent.3: Mark *_np() old function as [[deprecated]]Alejandro Colomar2022-09-05-0/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* ustat.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | Glibc 2.28 removed the wrapper for this syscall. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* stime.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-1/+1
| | | | | | | This syscall was removed from glibc 2.31 for newly linked programs. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* statfs.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-2/+2
| | | | | | LSB deprecated these syscalls in favor of [f]statvfs(3). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* sigprocmask.2: SYNOPSIS: Mark the legacy system call as [[deprecated]]Alejandro Colomar2022-09-05-5/+7
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* remap_file_pages.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-2/+3
| | | | | | This syscall was marked as deprecated in Linux 3.16. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* query_module.2: SYNOPSIS: Mark as [[deprecated]]Alejandro Colomar2022-09-05-5/+3
| | | | | | This syscall was removed in Linux 2.6. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>