tools/testing/selftests/mm/hugepage-shm.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/mm/hugepage-shm.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/mm/hugepage-shm.c
Extension
.c
Size
1934 bytes
Lines
82
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

if (shmaddr[i] != (char)i) {
			printf("\nIndex %lu mismatched\n", i);
			exit(3);
		}
	dprintf("Done.\n");

	if (shmdt((const void *)shmaddr) != 0) {
		perror("Detach failure");
		shmctl(shmid, IPC_RMID, NULL);
		exit(4);
	}

	shmctl(shmid, IPC_RMID, NULL);

	return 0;
}

Annotation

Implementation Notes