1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 2f08c3bdfSopenharmony_ci/* 3f08c3bdfSopenharmony_ci * Copyright (c) 2015 Linux Test Project 4f08c3bdfSopenharmony_ci */ 5f08c3bdfSopenharmony_ci#ifndef LAPI_SEM_H__ 6f08c3bdfSopenharmony_ci#define LAPI_SEM_H__ 7f08c3bdfSopenharmony_ci 8f08c3bdfSopenharmony_ci#include <sys/sem.h> 9f08c3bdfSopenharmony_ci 10f08c3bdfSopenharmony_ci#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) 11f08c3bdfSopenharmony_ci/* union semun is defined by including <sys/sem.h> */ 12f08c3bdfSopenharmony_ci#else 13f08c3bdfSopenharmony_ci/* according to X/OPEN we have to define it ourselves */ 14f08c3bdfSopenharmony_ciunion semun { 15f08c3bdfSopenharmony_ci int val; /* value for SETVAL */ 16f08c3bdfSopenharmony_ci struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ 17f08c3bdfSopenharmony_ci unsigned short *array; /* array for GETALL, SETALL */ 18f08c3bdfSopenharmony_ci /* Linux specific part: */ 19f08c3bdfSopenharmony_ci struct seminfo *__buf; /* buffer for IPC_INFO */ 20f08c3bdfSopenharmony_ci}; 21f08c3bdfSopenharmony_ci#endif 22f08c3bdfSopenharmony_ci 23f08c3bdfSopenharmony_ci#ifndef SEM_STAT_ANY 24f08c3bdfSopenharmony_ci# define SEM_STAT_ANY 20 25f08c3bdfSopenharmony_ci#endif 26f08c3bdfSopenharmony_ci 27f08c3bdfSopenharmony_ci#ifndef SEMMSL 28f08c3bdfSopenharmony_ci# define SEMMSL 32000 29f08c3bdfSopenharmony_ci#endif 30f08c3bdfSopenharmony_ci 31f08c3bdfSopenharmony_ci#endif /* LAPI_SEM_H__ */ 32