solaris.cc revision 2600
110390SAndreas.Sandberg@ARM.com/*
210390SAndreas.Sandberg@ARM.com * Copyright (c) 2003-2005 The Regents of The University of Michigan
310390SAndreas.Sandberg@ARM.com * All rights reserved.
410390SAndreas.Sandberg@ARM.com *
510390SAndreas.Sandberg@ARM.com * Redistribution and use in source and binary forms, with or without
610390SAndreas.Sandberg@ARM.com * modification, are permitted provided that the following conditions are
710390SAndreas.Sandberg@ARM.com * met: redistributions of source code must retain the above copyright
810390SAndreas.Sandberg@ARM.com * notice, this list of conditions and the following disclaimer;
910390SAndreas.Sandberg@ARM.com * redistributions in binary form must reproduce the above copyright
1010390SAndreas.Sandberg@ARM.com * notice, this list of conditions and the following disclaimer in the
1110390SAndreas.Sandberg@ARM.com * documentation and/or other materials provided with the distribution;
1210390SAndreas.Sandberg@ARM.com * neither the name of the copyright holders nor the names of its
1310390SAndreas.Sandberg@ARM.com * contributors may be used to endorse or promote products derived from
1410390SAndreas.Sandberg@ARM.com * this software without specific prior written permission.
1510390SAndreas.Sandberg@ARM.com *
1610390SAndreas.Sandberg@ARM.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1710390SAndreas.Sandberg@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1810390SAndreas.Sandberg@ARM.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1910390SAndreas.Sandberg@ARM.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2010390SAndreas.Sandberg@ARM.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2110390SAndreas.Sandberg@ARM.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2210390SAndreas.Sandberg@ARM.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2310390SAndreas.Sandberg@ARM.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2410390SAndreas.Sandberg@ARM.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2510390SAndreas.Sandberg@ARM.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2610390SAndreas.Sandberg@ARM.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2710390SAndreas.Sandberg@ARM.com */
2810390SAndreas.Sandberg@ARM.com
2910390SAndreas.Sandberg@ARM.com#include "arch/sparc/solaris/solaris.hh"
3010390SAndreas.Sandberg@ARM.com
3110390SAndreas.Sandberg@ARM.com// open(2) flags translation table
3210390SAndreas.Sandberg@ARM.comOpenFlagTransTable SparcSolaris::openFlagTable[] = {
3310390SAndreas.Sandberg@ARM.com#ifdef _MSC_VER
3410390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_RDONLY,	_O_RDONLY },
3510390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_WRONLY,	_O_WRONLY },
3610390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_RDWR,	_O_RDWR },
3710390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_APPEND,	_O_APPEND },
3810390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_CREAT,	_O_CREAT },
3910390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_TRUNC,	_O_TRUNC },
4011793Sbrandon.potter@amd.com  { SparcSolaris::TGT_O_EXCL,	_O_EXCL },
4111793Sbrandon.potter@amd.com#ifdef _O_NONBLOCK
4210390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_NONBLOCK,	_O_NONBLOCK },
4310390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_NDELAY  ,	_O_NONBLOCK },
4410390SAndreas.Sandberg@ARM.com#endif
4510390SAndreas.Sandberg@ARM.com#ifdef _O_NOCTTY
4610390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_NOCTTY,	_O_NOCTTY },
4710390SAndreas.Sandberg@ARM.com#endif
4810390SAndreas.Sandberg@ARM.com#ifdef _O_SYNC
4910390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_SYNC,	_O_SYNC },
5010390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_DSYNC,	_O_SYNC },
5110390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_RSYNC,	_O_SYNC },
5210390SAndreas.Sandberg@ARM.com#endif
5310390SAndreas.Sandberg@ARM.com#else /* !_MSC_VER */
5410390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_RDONLY,	O_RDONLY },
5510390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_WRONLY,	O_WRONLY },
5610390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_RDWR,	O_RDWR },
5710390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_APPEND,	O_APPEND },
5810390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_CREAT,	O_CREAT },
5910390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_TRUNC,	O_TRUNC },
6010390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_EXCL,	O_EXCL },
6110390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_NONBLOCK,	O_NONBLOCK },
6210390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_NDELAY  ,	O_NONBLOCK },
6310390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_NOCTTY,	O_NOCTTY },
6410390SAndreas.Sandberg@ARM.com#ifdef O_SYNC
6510390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_SYNC,	O_SYNC },
6610390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_DSYNC,	O_SYNC },
6710390SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_RSYNC,	O_SYNC },
6810390SAndreas.Sandberg@ARM.com#endif
6910390SAndreas.Sandberg@ARM.com#endif /* _MSC_VER */
7010390SAndreas.Sandberg@ARM.com};
7110390SAndreas.Sandberg@ARM.com
7210390SAndreas.Sandberg@ARM.comconst int SparcSolaris::NUM_OPEN_FLAGS =
7310390SAndreas.Sandberg@ARM.com        (sizeof(SparcSolaris::openFlagTable)/sizeof(SparcSolaris::openFlagTable[0]));
7414239Schunchenhsu@google.com
7510390SAndreas.Sandberg@ARM.com