solaris.cc revision 8229
19444SAndreas.Sandberg@ARM.com/*
29444SAndreas.Sandberg@ARM.com * Copyright (c) 2003-2005 The Regents of The University of Michigan
39444SAndreas.Sandberg@ARM.com * All rights reserved.
49444SAndreas.Sandberg@ARM.com *
59444SAndreas.Sandberg@ARM.com * Redistribution and use in source and binary forms, with or without
69444SAndreas.Sandberg@ARM.com * modification, are permitted provided that the following conditions are
79444SAndreas.Sandberg@ARM.com * met: redistributions of source code must retain the above copyright
89444SAndreas.Sandberg@ARM.com * notice, this list of conditions and the following disclaimer;
99444SAndreas.Sandberg@ARM.com * redistributions in binary form must reproduce the above copyright
109444SAndreas.Sandberg@ARM.com * notice, this list of conditions and the following disclaimer in the
119444SAndreas.Sandberg@ARM.com * documentation and/or other materials provided with the distribution;
129444SAndreas.Sandberg@ARM.com * neither the name of the copyright holders nor the names of its
139444SAndreas.Sandberg@ARM.com * contributors may be used to endorse or promote products derived from
142329SN/A * this software without specific prior written permission.
151689SN/A *
161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271689SN/A *
281689SN/A * Authors: Ali Saidi
291689SN/A */
301689SN/A
311689SN/A#include <fcntl.h>
321689SN/A
331689SN/A#include "arch/sparc/solaris/solaris.hh"
341689SN/A
351689SN/A// open(2) flags translation table
361689SN/AOpenFlagTransTable SparcSolaris::openFlagTable[] = {
371689SN/A#ifdef _MSC_VER
381689SN/A  { SparcSolaris::TGT_O_RDONLY, _O_RDONLY },
392665Ssaidi@eecs.umich.edu  { SparcSolaris::TGT_O_WRONLY, _O_WRONLY },
402665Ssaidi@eecs.umich.edu  { SparcSolaris::TGT_O_RDWR,   _O_RDWR },
411689SN/A  { SparcSolaris::TGT_O_APPEND, _O_APPEND },
421689SN/A  { SparcSolaris::TGT_O_CREAT,  _O_CREAT },
438230Snate@binkert.org  { SparcSolaris::TGT_O_TRUNC,  _O_TRUNC },
448230Snate@binkert.org  { SparcSolaris::TGT_O_EXCL,   _O_EXCL },
456658Snate@binkert.org#ifdef _O_NONBLOCK
461717SN/A  { SparcSolaris::TGT_O_NONBLOCK,       _O_NONBLOCK },
478230Snate@binkert.org  { SparcSolaris::TGT_O_NDELAY  ,       _O_NONBLOCK },
488232Snate@binkert.org#endif
498232Snate@binkert.org#ifdef _O_NOCTTY
506221Snate@binkert.org  { SparcSolaris::TGT_O_NOCTTY, _O_NOCTTY },
518793Sgblack@eecs.umich.edu#endif
521060SN/A#ifdef _O_SYNC
538737Skoansin.tan@gmail.com  { SparcSolaris::TGT_O_SYNC,   _O_SYNC },
548737Skoansin.tan@gmail.com  { SparcSolaris::TGT_O_DSYNC,  _O_SYNC },
558737Skoansin.tan@gmail.com  { SparcSolaris::TGT_O_RSYNC,  _O_SYNC },
565529Snate@binkert.org#endif
571060SN/A#else /* !_MSC_VER */
585529Snate@binkert.org  { SparcSolaris::TGT_O_RDONLY, O_RDONLY },
594329Sktlim@umich.edu  { SparcSolaris::TGT_O_WRONLY, O_WRONLY },
604329Sktlim@umich.edu  { SparcSolaris::TGT_O_RDWR,   O_RDWR },
612292SN/A  { SparcSolaris::TGT_O_APPEND, O_APPEND },
622292SN/A  { SparcSolaris::TGT_O_CREAT,  O_CREAT },
632292SN/A  { SparcSolaris::TGT_O_TRUNC,  O_TRUNC },
642292SN/A  { SparcSolaris::TGT_O_EXCL,   O_EXCL },
655529Snate@binkert.org  { SparcSolaris::TGT_O_NONBLOCK,       O_NONBLOCK },
661060SN/A  { SparcSolaris::TGT_O_NDELAY  ,       O_NONBLOCK },
679444SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_NOCTTY, O_NOCTTY },
689444SAndreas.Sandberg@ARM.com#ifdef O_SYNC
699444SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_SYNC,   O_SYNC },
709444SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_DSYNC,  O_SYNC },
719444SAndreas.Sandberg@ARM.com  { SparcSolaris::TGT_O_RSYNC,  O_SYNC },
729444SAndreas.Sandberg@ARM.com#endif
739444SAndreas.Sandberg@ARM.com#endif /* _MSC_VER */
749444SAndreas.Sandberg@ARM.com};
759444SAndreas.Sandberg@ARM.com
769444SAndreas.Sandberg@ARM.comconst int SparcSolaris::NUM_OPEN_FLAGS =
779444SAndreas.Sandberg@ARM.com        (sizeof(SparcSolaris::openFlagTable)/sizeof(SparcSolaris::openFlagTable[0]));
789444SAndreas.Sandberg@ARM.com
799444SAndreas.Sandberg@ARM.com