forked from DragonOS-Community/DragonOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(time): Add syscall support for utime* (DragonOS-Community#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
- Loading branch information
Showing
10 changed files
with
232 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test_utimensat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "test_utimensat", | ||
"version": "0.1.0", | ||
"description": "test_utimensat", | ||
"task_type": { | ||
"BuildFromSource": { | ||
"Local": { | ||
"path": "apps/test_utimensat" | ||
} | ||
} | ||
}, | ||
"depends": [], | ||
"build": { | ||
"build_command": "make install" | ||
}, | ||
"install": { | ||
"in_dragonos_path": "/bin" | ||
}, | ||
"clean": { | ||
"clean_command": "make clean" | ||
}, | ||
"target_arch": ["x86_64"] | ||
} |