/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Test that the shm_unlink() function sets errno = ENAMETOOLONG if the length * of a pathname component is longer than {NAME_MAX} (not including the * terminating null). */ #include #include #include #include #include #include #include "posixtest.h" int main() { int result, i; long name_max; char *shm_name; name_max = pathconf("/", _PC_NAME_MAX); shm_name = malloc(name_max+3); shm_name[0] = '/'; for(i=1; i