Logo Search packages:      
Sourcecode: condor version File versions  Download package

syscall_mode.c

/***************************************************************
 *
 * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
 * University of Wisconsin-Madison, WI.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ***************************************************************/


 

/*******************************************************************
**
** Manage system call mode and do remote system calls.
**
*******************************************************************/

#define _POSIX_SOURCE
#include "condor_common.h"
#include "condor_debug.h"
#include "condor_syscall_mode.h"

static int        SyscallMode = 1; /* LOCAL and UNMAPPED */

void DisplaySyscallMode(void);

int
SetSyscalls( int mode )
{
      int   answer;
      answer = SyscallMode;
      SyscallMode = mode;
      return answer;
}

int
GetSyscallMode()
{
      return SyscallMode;
}

BOOL
LocalSysCalls()
{
      return SyscallMode & SYS_LOCAL;
}

BOOL
RemoteSysCalls()
{
      return (SyscallMode & SYS_LOCAL) == 0;
}

BOOL
MappingFileDescriptors()
{
      return (SyscallMode & SYS_MAPPED);
}

void
DisplaySyscallMode()
{
      dprintf( D_ALWAYS,
            "Syscall Mode is: %s %s\n",
            RemoteSysCalls() ? "REMOTE" : "LOCAL",
            MappingFileDescriptors() ? "MAPPED" : "UNMAPPED"
      );
}

Generated by  Doxygen 1.6.0   Back to index