lstat.c (311B)
1 /* 2 * lstat.c - lstat system call 3 * Copyright (C) 2026. All rights reserved. 4 */ 5 6 #include "libc.h" 7 8 int lstat(const char *pathname, struct stat *statbuf) { 9 long ret = syscall(SYS_lstat, (long)pathname, (long)statbuf, 0, 0, 0, 0); 10 11 if (ret < 0) { 12 errno = -ret; 13 return -1; 14 } 15 16 return (int)ret; 17 }