lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #include <stdio.h> |
| 2 | #include <unistd.h> |
| 3 | #include <stdlib.h> |
| 4 | #include <sys/stat.h> |
| 5 | int main() |
| 6 | { |
| 7 | struct stat statbuf; |
| 8 | int ret = 0; |
| 9 | char* loop255 = "/dev/loop255"; |
| 10 | char* loop256 = "/dev/loop256"; |
| 11 | mode_t mode = 0660; |
| 12 | mknod(loop255, mode, 0x7ff); |
| 13 | mknod(loop256, mode, 0x100700); |
| 14 | ret = stat(loop255, &statbuf); |
| 15 | if(ret < 0) { |
| 16 | printf("stat: Cant stat %s\n",loop255); |
| 17 | unlink(loop255); |
| 18 | exit(1); |
| 19 | } |
| 20 | ret = stat(loop256, &statbuf); |
| 21 | if(ret < 0) { |
| 22 | printf("stat: Cant stat %s\n",loop256); |
| 23 | unlink(loop255); |
| 24 | unlink(loop256); |
| 25 | exit(1); |
| 26 | } |
| 27 | |
| 28 | unlink(loop255); |
| 29 | unlink(loop256); |
| 30 | exit(0); |
| 31 | } |
| 32 | |