Back to index

lightning-sunbird  0.9+nobinonly
Functions
pripc.c File Reference
#include "primpl.h"
#include <string.h>

Go to the source code of this file.

Functions

static void _pr_ConvertSemName (char *result)
static void _pr_ConvertShmName (char *result)
PRStatus _PR_MakeNativeIPCName (const char *name, char *result, PRIntn size, _PRIPCType type)

Function Documentation

static void _pr_ConvertSemName ( char *  result) [static]

Definition at line 61 of file pripc.c.

{
#ifdef _PR_HAVE_POSIX_SEMAPHORES
#if defined(SOLARIS)
    char *p;

    /* Convert '/' to '_' except for the leading '/' */
    for (p = result+1; *p; p++) {
        if (*p == '/') {
            *p = '_';
        }
    }
    return;
#else
    return;
#endif
#elif defined(_PR_HAVE_SYSV_SEMAPHORES)
    return;
#elif defined(WIN32)
    return;
#endif
}

Here is the caller graph for this function:

static void _pr_ConvertShmName ( char *  result) [static]

Definition at line 84 of file pripc.c.

{
#if defined(PR_HAVE_POSIX_NAMED_SHARED_MEMORY)
#if defined(SOLARIS)
    char *p;

    /* Convert '/' to '_' except for the leading '/' */
    for (p = result+1; *p; p++) {
        if (*p == '/') {
            *p = '_';
        }
    }
    return;
#else
    return;
#endif
#elif defined(PR_HAVE_SYSV_NAMED_SHARED_MEMORY)
    return;
#elif defined(WIN32)
    return;
#else
    return;
#endif
}

Here is the caller graph for this function:

PRStatus _PR_MakeNativeIPCName ( const char *  name,
char *  result,
PRIntn  size,
_PRIPCType  type 
)

Definition at line 109 of file pripc.c.

{
    if (strlen(name) >= (PRSize)size) {
        PR_SetError(PR_BUFFER_OVERFLOW_ERROR, 0);
        return PR_FAILURE;
    }
    strcpy(result, name);
    switch (type) {
        case _PRIPCSem:
            _pr_ConvertSemName(result);
            break;
        case _PRIPCShm:
            _pr_ConvertShmName(result);
            break;
        default:
            PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
            return PR_FAILURE;
    }
    return PR_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function: