IXP_STAT(3)

πŸ“¦ version 0-unstable-2022-04, in nixos 26.05, nixpkgs unstable

πŸ’… ixp_stat(3) β€” Library Functions Manual πŸ’…

πŸ‘‘ NAME πŸ‘‘

okay so bestie, this page is all about ixp_stat, ixp_fstat, IxpStat, IxpQid, IxpQType, and IxpDMode β€” the whole stat squad. periodt. πŸ’–


✨ SYNOPSIS ✨

no cap, here's the exact code, character for character:

#include <ixp.h>

IxpStat *ixp_stat(IxpClient *c, const char *path);

IxpStat *ixp_fstat(IxpCFid *fid);

typedef struct IxpStat IxpStat;
struct IxpStat {
        uint16_t        type;
        uint32_t        dev;
        IxpQid          qid;
        uint32_t        mode;
        uint32_t        atime;
        uint32_t        mtime;
        uint64_t        length;
        char*   name;
        char*   uid;
        char*   gid;
        char*   muid;
}

typedef struct IxpQid IxpQid;
struct IxpQid {
        uint8_t         type;
        uint32_t        version;
        uint64_t        path;
        /* Private members */
        ...
}

enum IxpQType {
        P9_QTDIR        = 0x80, /* type bit for directories */
        P9_QTAPPEND     = 0x40, /* type bit for append only files */
        P9_QTEXCL       = 0x20, /* type bit for exclusive use files */
        P9_QTMOUNT      = 0x10, /* type bit for mounted channel */
        P9_QTAUTH       = 0x08, /* type bit for authentication file */
        P9_QTTMP        = 0x04, /* type bit for non-backed-up file */
        P9_QTSYMLINK    = 0x02, /* type bit for symbolic link */
        P9_QTFILE       = 0x00  /* type bits for plain file */
}

enum IxpDMode {
        P9_DMEXEC       = 0x1,          /* mode bit for execute permission */
        P9_DMWRITE      = 0x2,          /* mode bit for write permission */
        P9_DMREAD       = 0x4,          /* mode bit for read permission */

#define P9_DMDIR        0x80000000      /* mode bit for directories */
#define P9_DMAPPEND     0x40000000      /* mode bit for append only files */
#define P9_DMEXCL       0x20000000      /* mode bit for exclusive use files */
#define P9_DMMOUNT      0x10000000      /* mode bit for mounted channel */
#define P9_DMAUTH       0x08000000      /* mode bit for authentication file */
#define P9_DMTMP        0x04000000      /* mode bit for non-backed-up file */
#define P9_DMSYMLINK    0x02000000      /* mode bit for symbolic link (Unix, 9P2000.u) */
#define P9_DMDEVICE     0x00800000      /* mode bit for device file (Unix, 9P2000.u) */
#define P9_DMNAMEDPIPE  0x00200000      /* mode bit for named pipe (Unix, 9P2000.u) */
#define P9_DMSOCKET     0x00100000      /* mode bit for socket (Unix, 9P2000.u) */
#define P9_DMSETUID     0x00080000      /* mode bit for setuid (Unix, 9P2000.u) */
#define P9_DMSETGID     0x00040000      /* mode bit for setgid (Unix, 9P2000.u) */
}

πŸŽ€ PARAMETERS πŸŽ€

  • path β€” the path of the file to stat. yes bestie, point at the file.
  • fid β€” an open file descriptor to stat. it's already open, we're just checking it out.

🌸 DESCRIPTION 🌸

Stats the file at path or pointed to by fid. that's literally the vibe. πŸ’…

πŸ¦‹ RETURN VALUE πŸ¦‹

Returns an IxpStat structure β€” and listen, this part matters: the caller must free it with free(3). not optional, not a drill. free your IxpStat, bestie. 😭

🌈 SEE ALSO 🌈


mwah πŸ’‹ this page came from the libixp Manual, dated 2012 Dec. periodt. 🫢

πŸ“¦ where this page comes from