search for: align_ptr

Displaying 1 result from an estimated 1 matches for "align_ptr".

Did you mean: aligned_ptr
2006 Oct 15
3
open(2) O_DIRECT on smbmount gives EINVAL
...n open(2). #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <stdint.h> #define SECTORSIZE 512 #define ALIGN_NUM(val, mult) (((val) + ((mult) - 1)) & ~(((mult) - 1))) #define ALIGN_PTR(ptr, mult) (void *)ALIGN_NUM((uintptr_t)(ptr), mult) #define DECL_ALIGNED_BUFFER(name, size) \ char __##name[(size) + SECTORSIZE]; \ char *name = (char *)ALIGN_PTR(__##name, SECTORSIZE) #define TEST_FILE "test.txt" int main(void) { int fd; int len = SECTORSIZE; DECL_ALIG...