#undef _FORTIFY_SOURCE
-// Humor glibc to get dprintf, then #define it to something more portable.
-#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+
+#define _POSIX_C_SOURCE 200809L
+#define _XOPEN_SOURCE 600
+#define _BSD_SOURCE
+#define _SVID_SOURCE
+
#include <stdio.h>
#define fdprintf(...) dprintf(__VA_ARGS__)
#include <grp.h>
#include <inttypes.h>
#include <limits.h>
+#include <libgen.h>
+#include <math.h>
#include <pty.h>
#include <pwd.h>
+#include <sched.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdint.h>
#include <sys/sysinfo.h>
#include <sys/swap.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <sys/wait.h>
#include <unistd.h>
#include <utime.h>
+#include <utmpx.h>
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
*/
#include "toys.h"
-#include <libgen.h>
void dirname_main(void)
{
-u Show only the effective user ID
*/
-#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
#include "toys.h"
#define FLAG_n (1<<4)
#define FLAG_r (1<<1)
#define FLAG_u 1
-void
-pretty_print(struct passwd *pw, struct group *grp, struct group **grps, int n)
+void pretty_print(struct passwd *pw, struct group *grp, struct group **grps,
+ int n)
{
int i;
printf("uid= %d(%s) gid= %d(%s)", pw->pw_uid, pw->pw_name,
-l show full details for each file
*/
-/* So that we can do 64-bit stat etc... */
-#define _FILE_OFFSET_BITS 64
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <grp.h>
-#include <pwd.h>
-
#include "toys.h"
#define FLAG_a 1
*/
#include "toys.h"
-#include <math.h>
DEFINE_GLOBALS(
char *key_separator;
*/
#include "toys.h"
-#include <sys/utsname.h>
// If a 32 bit x86 build environment working in a chroot under an x86-64
// kernel returns x86_64 for -m it confuses ./configure. Special case it.
#include "toys.h"
-#include <sched.h>
-
void unshare_main(void)
{
unsigned flags[]={CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC, CLONE_NEWNET,0};
*/
#include "toys.h"
-#include <time.h>
-#include <utmpx.h>
void who_main(void)
{