search for: max_linksiz

Displaying 3 results from an estimated 3 matches for "max_linksiz".

2011 Jul 07
5
[PATCH 0/5] checkpatch cleanups
It seems checkpatch errors krept in, this is a first go. Next run will go into usr/kinit directory. No code changes, just codingstyle fixes (verified with size(3)). maximilian attems (5): [klibc] sleep: have argument on next line [klibc] readklink: remove unneeded braces [klibc] mount: whitespace policy [klibc] ls: fix various checkpatch complaints [klibc] tests: checkpatch fixlets
2009 May 29
1
[PATCH v2] klibc-utils: add simple ls
...@@ -0,0 +1,202 @@ +#include <stdio.h> +#include <stdlib.h> +#include <dirent.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <sys/sysmacros.h> + +#define STAT_ISSET(mode, mask) (((mode) & mask) == mask) + +static size_t max_linksiz = 128; +static int max_nlinks = 1; +static int max_size = 1; +static int max_uid = 1; +static int max_gid = 1; +static int max_min = 1; +static int max_maj = 1; + +static void do_preformat(const struct stat *st) +{ + int bytes; + + if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->...
2023 Jan 13
0
[klibc:master] ls: Handle relative directory names correctly
...*st, const char *path) +static void do_stat(const struct stat *st, int dir_fd, const char *path) { char *fmt, *link_name; int rc; @@ -138,7 +138,7 @@ static void do_stat(const struct stat *st, const char *path) perror("malloc"); exit(1); } - rc = readlink(path, link_name, max_linksiz); + rc = readlinkat(dir_fd, path, link_name, max_linksiz); if (rc == -1) { free(link_name); perror("readlink"); @@ -156,28 +156,26 @@ static void do_stat(const struct stat *st, const char *path) static void do_dir(const char *path, int preformat) { DIR *dir; + int dir_fd;...