diff options
Diffstat (limited to 'src/kernel/arch/amd64/driver/util.h')
-rw-r--r-- | src/kernel/arch/amd64/driver/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kernel/arch/amd64/driver/util.h b/src/kernel/arch/amd64/driver/util.h index bfdd25c..c91605c 100644 --- a/src/kernel/arch/amd64/driver/util.h +++ b/src/kernel/arch/amd64/driver/util.h @@ -3,3 +3,10 @@ struct vfs_request; int req_readcopy(struct vfs_request *req, const void *buf, size_t len); + +/* compare request path. path MUST be a static string */ +#define reqpathcmp(req, path) _reqpathcmp(req, ""path"", sizeof(path) - 1) +#define _reqpathcmp(req, path, plen) \ + (req->input.kern && \ + req->input.len == plen && \ + memcmp(req->input.buf_kern, path, plen) == 0) |