add sys_add_three_integers
This commit is contained in:
@@ -157,5 +157,6 @@ char *getcwd(char *buf, size_t buflen); /* calls __getcwd */
|
||||
time_t time(time_t *seconds); /* calls __time */
|
||||
|
||||
int printchar(char c);
|
||||
int add_three_integers(int a, int b, int c);
|
||||
|
||||
#endif /* _UNISTD_H_ */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
TOP=../..
|
||||
.include "$(TOP)/mk/os161.config.mk"
|
||||
|
||||
SUBDIRS=add argtest badcall bigexec bigfile bigfork bigseek bloat conman \
|
||||
SUBDIRS=add add_three_integers argtest badcall bigexec bigfile bigfork bigseek bloat conman \
|
||||
crash ctest dirconc dirseek dirtest f_test factorial farm faulter \
|
||||
filetest forkbomb forktest frack hash hog huge \
|
||||
malloctest matmult multiexec palin parallelvm poisondisk printchartest psort \
|
||||
|
||||
10
userland/testbin/add_three_integers/Makefile
Normal file
10
userland/testbin/add_three_integers/Makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
# Makefile for add_three_integers
|
||||
|
||||
TOP=../../..
|
||||
.include "$(TOP)/mk/os161.config.mk"
|
||||
|
||||
PROG=add_three_integers
|
||||
SRCS=add_three_integers.c
|
||||
BINDIR=/testbin
|
||||
|
||||
.include "$(TOP)/mk/os161.prog.mk"
|
||||
10
userland/testbin/add_three_integers/add_three_integers.c
Normal file
10
userland/testbin/add_three_integers/add_three_integers.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <unistd.h>
|
||||
|
||||
extern int add_three_integers(int a, int b, int c);
|
||||
|
||||
int main() {
|
||||
add_three_integers(3, 5, 2); // should output 10
|
||||
add_three_integers(-5, 3, 1); // should output -1
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user