Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
script3r
GitHub Repository: script3r/os161
Path: blob/master/user/testbin/ft1/ft1.c
734 views
1
#include <unistd.h>
2
#include <stdio.h>
3
#include <stdlib.h>
4
5
int main( int argc, char *argv[] ) {
6
int fd_stdout = 0;
7
8
(void)argc;
9
(void)argv;
10
11
//attempt to open stdout
12
fd_stdout = open( "con:", O_WRONLY );
13
if( fd_stdout == -1 )
14
return -1;
15
16
//now we can write
17
char message[] = "Hello World!";
18
write( fd_stdout, message, sizeof( message ) );
19
20
//close the file
21
close( fd_stdout );
22
23
return 0;
24
}
25
26