mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
feat(time): Add syscall support for utime* (#838)
* feat(vfs): Add syscall support for utime* impl sys_utimensat impl sys_utimes add utimensat test fix some warning * fix(vfs): Verify pointer validity * fix: remove bad cfg
This commit is contained in:
1
user/apps/test_utimensat/.gitignore
vendored
Normal file
1
user/apps/test_utimensat/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
test_utimensat
|
20
user/apps/test_utimensat/Makefile
Normal file
20
user/apps/test_utimensat/Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
ifeq ($(ARCH), x86_64)
|
||||
CROSS_COMPILE=x86_64-linux-musl-
|
||||
else ifeq ($(ARCH), riscv64)
|
||||
CROSS_COMPILE=riscv64-linux-musl-
|
||||
endif
|
||||
|
||||
CC=$(CROSS_COMPILE)gcc
|
||||
|
||||
.PHONY: all
|
||||
all: main.c
|
||||
$(CC) -static -o test_utimensat main.c
|
||||
|
||||
.PHONY: install clean
|
||||
install: all
|
||||
mv test_utimensat $(DADK_CURRENT_BUILD_DIR)/test_utimensat
|
||||
|
||||
clean:
|
||||
rm test_utimensat *.o
|
||||
|
||||
fmt:
|
12
user/apps/test_utimensat/main.c
Normal file
12
user/apps/test_utimensat/main.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
int main(){
|
||||
int res = utimensat(AT_FDCWD, "/bin/about.elf", NULL, 0);
|
||||
printf("utimensat res = %d\n", res);
|
||||
}
|
Reference in New Issue
Block a user