linux.cc revision 2665
12579SN/A/* 22579SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan 32579SN/A * All rights reserved. 42579SN/A * 52579SN/A * Redistribution and use in source and binary forms, with or without 62579SN/A * modification, are permitted provided that the following conditions are 72579SN/A * met: redistributions of source code must retain the above copyright 82579SN/A * notice, this list of conditions and the following disclaimer; 92579SN/A * redistributions in binary form must reproduce the above copyright 102579SN/A * notice, this list of conditions and the following disclaimer in the 112579SN/A * documentation and/or other materials provided with the distribution; 122579SN/A * neither the name of the copyright holders nor the names of its 132579SN/A * contributors may be used to endorse or promote products derived from 142579SN/A * this software without specific prior written permission. 152579SN/A * 162579SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172579SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182579SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192579SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202579SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212579SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222579SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232579SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242579SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252579SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262579SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Gabe Black 292579SN/A */ 302579SN/A 312579SN/A#include "arch/sparc/linux/linux.hh" 322579SN/A 332579SN/A// open(2) flags translation table 342579SN/AOpenFlagTransTable SparcLinux::openFlagTable[] = { 352579SN/A#ifdef _MSC_VER 362579SN/A { SparcLinux::TGT_O_RDONLY, _O_RDONLY }, 372579SN/A { SparcLinux::TGT_O_WRONLY, _O_WRONLY }, 382579SN/A { SparcLinux::TGT_O_RDWR, _O_RDWR }, 392579SN/A { SparcLinux::TGT_O_APPEND, _O_APPEND }, 402579SN/A { SparcLinux::TGT_O_CREAT, _O_CREAT }, 412579SN/A { SparcLinux::TGT_O_TRUNC, _O_TRUNC }, 422579SN/A { SparcLinux::TGT_O_EXCL, _O_EXCL }, 432579SN/A#ifdef _O_NONBLOCK 442579SN/A { SparcLinux::TGT_O_NONBLOCK, _O_NONBLOCK }, 452579SN/A#endif 462579SN/A#ifdef _O_NOCTTY 472579SN/A { SparcLinux::TGT_O_NOCTTY, _O_NOCTTY }, 482579SN/A#endif 492579SN/A#ifdef _O_SYNC 502579SN/A { SparcLinux::TGT_O_SYNC, _O_SYNC }, 512579SN/A#endif 522579SN/A#else /* !_MSC_VER */ 532579SN/A { SparcLinux::TGT_O_RDONLY, O_RDONLY }, 542579SN/A { SparcLinux::TGT_O_WRONLY, O_WRONLY }, 552579SN/A { SparcLinux::TGT_O_RDWR, O_RDWR }, 562579SN/A { SparcLinux::TGT_O_APPEND, O_APPEND }, 572579SN/A { SparcLinux::TGT_O_CREAT, O_CREAT }, 582579SN/A { SparcLinux::TGT_O_TRUNC, O_TRUNC }, 592579SN/A { SparcLinux::TGT_O_EXCL, O_EXCL }, 602579SN/A { SparcLinux::TGT_O_NONBLOCK, O_NONBLOCK }, 612579SN/A { SparcLinux::TGT_O_NOCTTY, O_NOCTTY }, 622579SN/A#ifdef O_SYNC 632579SN/A { SparcLinux::TGT_O_SYNC, O_SYNC }, 642579SN/A#endif 652579SN/A#endif /* _MSC_VER */ 662579SN/A}; 672579SN/A 682579SN/Aconst int SparcLinux::NUM_OPEN_FLAGS = 692579SN/A (sizeof(SparcLinux::openFlagTable)/sizeof(SparcLinux::openFlagTable[0])); 702579SN/A 71