/*
* Copyright (c) 2000-2001, 2003, 2005 Proofpoint, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*/
#if SM_CONF_SHM
# include <stdlib.h>
# include <unistd.h>
# include <errno.h>
/*
** SM_SHMSTART -- initialize shared memory segment.
**
** Parameters:
** key -- key for shared memory.
** size -- size of segment.
** shmflag -- initial flags.
** shmid -- pointer to return id.
** owner -- create segment.
**
** Returns:
** pointer to shared memory segment,
** NULL on failure.
**
** Side Effects:
** attaches shared memory segment.
*/
void *
int size;
int shmflg;
int *shmid;
bool owner;
{
int save_errno;
if (shmflg == 0)
if (owner)
if (*shmid < 0)
goto error;
if (shm == SM_SHM_NULL)
goto error;
return shm;
save_errno = errno;
*shmid = SM_SHM_NO_ID;
errno = save_errno;
return (void *) 0;
}
/*
** SM_SHMSTOP -- stop using shared memory segment.
**
** Parameters:
** shm -- pointer to shared memory.
** shmid -- id.
** owner -- delete segment.
**
** Returns:
** 0 on success.
** < 0 on failure.
**
** Side Effects:
** detaches (and maybe removes) shared memory segment.
*/
int
void *shm;
int shmid;
bool owner;
{
int r;
return r;
return r;
return 0;
}
/*
**
** Parameters:
** shmid -- id.
** uid -- uid to use
** gid -- gid to use
** mode -- mode to use
**
** Returns:
** 0 on success.
** < 0 on failure.
*/
int
int shmid;
{
int r;
return r;
return r;
return 0;
}
#endif /* SM_CONF_SHM */