X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=tests%2Fstat%2Fstat.psi;fp=tests%2Fstat%2Fstat.psi;h=e5d8eba135b6e22a4052ca4e90c550332db44f84;hp=001756585ef782201567ed6e231b8b2ccd338b87;hb=a6ffb2bfbf83ef3511cc356bd931d460feabe7a2;hpb=3c53642a0adccd4b602d147833da24eb4b73bccc diff --git a/tests/stat/stat.psi b/tests/stat/stat.psi index 0017565..e5d8eba 100644 --- a/tests/stat/stat.psi +++ b/tests/stat/stat.psi @@ -1,8 +1,48 @@ -extern int __xstat64(int ver, char *path, struct stat *buf); +extern int stat(char *path, struct stat *buf); function psi\stat(string $path, array &$buf = NULL) : int { - let ver = NULL; let path = strval($path); let buf = calloc(1, struct stat); - return to_int(__xstat64); - set $buf = to_array(*buf); + return to_int(stat); + set $buf = to_array(*buf, + to_int(st_dev), + to_int(st_ino), + to_int(st_mode), + to_int(st_nlink), + to_int(st_uid), + to_int(st_gid), + to_int(st_rdev), + to_int(st_size), + to_array(st_atim, + to_int(tv_sec), + to_int(tv_nsec) + ), + to_array(st_atimespec, + to_int(tv_sec), + to_int(tv_nsec) + ), + to_array(st_mtim, + to_int(tv_sec), + to_int(tv_nsec) + ), + to_array(st_mtimespec, + to_int(tv_sec), + to_int(tv_nsec) + ), + to_array(st_ctim, + to_int(tv_sec), + to_int(tv_nsec) + ), + to_array(st_ctimespec, + to_int(tv_sec), + to_int(tv_nsec) + ), + to_array(st_birthtimespec, + to_int(tv_sec), + to_int(tv_nsec) + ), + to_int(st_blksize), + to_int(st_blocks), + to_int(st_flags), + to_int(st_gen) + ); }