miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
main.c File Reference

Read-only ifconfig — prints eth0 inet address, MAC, and byte counters from sysfs. Per D-01, D-05. More...

#include <string.h>
#include <unistd.h>
#include <fcntl.h>
Include dependency graph for main.c:

Functions

static void rprint (const char *s)
static int read_sysfs (const char *path, char *buf, int bufsiz)
 Read a sysfs file into buf, strip trailing newline, null-terminate.
int main (void)

Detailed Description

Read-only ifconfig — prints eth0 inet address, MAC, and byte counters from sysfs. Per D-01, D-05.

Function Documentation

◆ main()

int main ( void )
Here is the call graph for this function:

◆ read_sysfs()

int read_sysfs ( const char * path,
char * buf,
int bufsiz )
static

Read a sysfs file into buf, strip trailing newline, null-terminate.

Parameters
pathSysfs path to open.
bufDestination buffer.
bufsizSize of destination buffer (including null terminator space).
Returns
Number of bytes read (excluding null), or -1 on error.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rprint()

void rprint ( const char * s)
static
Here is the call graph for this function:
Here is the caller graph for this function: