PatchworkOS
Loading...
Searching...
No Matches
main.c File Reference
#include <errno.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/io.h>

Go to the source code of this file.

Macros

#define BUFFER_SIZE   1024
 

Functions

static uint64_t read_fd (fd_t fd, const char *name, bool hexOutput)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   1024

Definition at line 9 of file main.c.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 43 of file main.c.

References close(), ERR, errno, EXIT_FAILURE, EXIT_SUCCESS, open(), printf(), read_fd(), STDIN_FILENO, strcmp(), and strerror().

◆ read_fd()

static uint64_t read_fd ( fd_t  fd,
const char *  name,
bool  hexOutput 
)
static

Definition at line 11 of file main.c.

References buffer, BUFFER_SIZE, close(), count, ERR, errno, printf(), read(), STDOUT_FILENO, strerror(), write(), and writef().

Referenced by main().