add sys_add_three_integers

This commit is contained in:
2024-09-12 12:59:18 -04:00
parent f5117281a3
commit 090b997d35
9 changed files with 40 additions and 1 deletions

View File

@@ -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_ */

View File

@@ -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 \

View 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"

View 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;
}