mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
tools/nolibc: unistd: Add readlink()
Add readlink(). This is needed to test getcwd(). Signed-off-by: Daniel Palmer <daniel@thingy.jp> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://patch.msgid.link/20260702085101.3304547-3-daniel@thingy.jp Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
parent
0fbc34f028
commit
94518b77e1
|
|
@ -128,6 +128,22 @@ int msleep(unsigned int msecs)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ssize_t readlink(const char *path, char *buf, size_t bufsiz);
|
||||
*/
|
||||
|
||||
static __attribute__((unused))
|
||||
ssize_t _sys_readlink(const char *path, char *buf, size_t bufsiz)
|
||||
{
|
||||
return __nolibc_syscall4(__NR_readlinkat, AT_FDCWD, path, buf, bufsiz);
|
||||
}
|
||||
|
||||
static __attribute__((unused))
|
||||
ssize_t readlink(const char *path, char *buf, size_t bufsiz)
|
||||
{
|
||||
return __sysret(_sys_readlink(path, buf, bufsiz));
|
||||
}
|
||||
|
||||
static __attribute__((unused))
|
||||
unsigned int sleep(unsigned int seconds)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user