]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-sysinfo: Add code comments
authorStefan Jumarea <stefanjumarea02@gmail.com>
Mon, 27 Nov 2023 13:46:11 +0000 (15:46 +0200)
committerStefan Jumarea <stefanjumarea02@gmail.com>
Mon, 27 Nov 2023 13:46:11 +0000 (15:46 +0200)
Add doxygen-style code comments to the `posix-sysinfo` internal library
files.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
lib/posix-sysinfo/include/sys/sysinfo.h
lib/posix-sysinfo/include/sys/utsname.h
lib/posix-sysinfo/sysinfo.c

index b5903da5216efdf326ab064af781dfcfe713235a..83af6b5a449491427a3cf77634b394fd8a324643 100644 (file)
@@ -33,6 +33,10 @@ extern "C" {
 
 #define SI_LOAD_SHIFT 16
 
+/**
+ * Structure used by the `sysinfo()` system call.
+ * Follows Linux conventions.
+ */
 struct sysinfo {
        unsigned long uptime;
        unsigned long loads[3];
@@ -49,7 +53,14 @@ struct sysinfo {
        char _f[20-2*sizeof(unsigned long)-sizeof(unsigned int)];
 };
 
+/**
+ * Follows Linux conventions for the `sysinfo()` system call.
+ */
 int sysinfo (struct sysinfo *);
+
+/**
+ * Functions currently not implemented.
+ */
 int get_nprocs_conf (void);
 int get_nprocs (void);
 long get_phys_pages (void);
index d3973c3debcdcee7c7720635a53c1d4dbaf7a148..4882fadca458c256063477f26d64c64cc6563131 100644 (file)
@@ -40,6 +40,10 @@ extern "C" {
 
 #define __UTSNAMELEN 65        /* synchronize with kernel */
 
+/**
+ * Structure used by the `uname()` system call.
+ * Follows Linux conventions.
+ */
 struct utsname {
        char sysname[__UTSNAMELEN];
        char nodename[__UTSNAMELEN];
index 4a511a358c9a45a3e56905e3807d6868581d9044..1fe312ec76a11ea2196e5893175096bb4a7c35eb 100644 (file)
 #include <vfscore/file.h>
 #endif
 
+/**
+ * The Unikraft `struct utsname` structure.
+ *
+ * * `sysname` and `nodename` are set to "unikraft".
+ * * `release` is set to * `5-{Unikraft Release Codename}` for glibc
+ *   compatibility (see the comments below).
+ * * `version` is set to the Unikraft full version.
+ * * `machine` is set to the current architecture.
+ */
 static struct utsname utsname = {
        .sysname        = "Unikraft",
        .nodename       = "unikraft",