linux.cc revision 7441
16019Shines@cs.fsu.edu/*
26019Shines@cs.fsu.edu * Copyright (c) 2003-2005 The Regents of The University of Michigan
36019Shines@cs.fsu.edu * Copyright (c) 2007-2008 The Florida State University
46019Shines@cs.fsu.edu * All rights reserved.
56019Shines@cs.fsu.edu *
66019Shines@cs.fsu.edu * Redistribution and use in source and binary forms, with or without
76019Shines@cs.fsu.edu * modification, are permitted provided that the following conditions are
86019Shines@cs.fsu.edu * met: redistributions of source code must retain the above copyright
96019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer;
106019Shines@cs.fsu.edu * redistributions in binary form must reproduce the above copyright
116019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer in the
126019Shines@cs.fsu.edu * documentation and/or other materials provided with the distribution;
136019Shines@cs.fsu.edu * neither the name of the copyright holders nor the names of its
146019Shines@cs.fsu.edu * contributors may be used to endorse or promote products derived from
156019Shines@cs.fsu.edu * this software without specific prior written permission.
166019Shines@cs.fsu.edu *
176019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
186019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
196019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
206019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
226019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
236019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
276019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286019Shines@cs.fsu.edu *
296019Shines@cs.fsu.edu * Authors: Stephen Hines
306019Shines@cs.fsu.edu */
316019Shines@cs.fsu.edu
326019Shines@cs.fsu.edu#include "arch/arm/linux/linux.hh"
336019Shines@cs.fsu.edu
346019Shines@cs.fsu.edu#include <fcntl.h>
356019Shines@cs.fsu.edu
366019Shines@cs.fsu.edu// open(2) flags translation table
376019Shines@cs.fsu.eduOpenFlagTransTable ArmLinux::openFlagTable[] = {
386019Shines@cs.fsu.edu#ifdef _MSC_VER
396019Shines@cs.fsu.edu  { ArmLinux::TGT_O_RDONLY,	_O_RDONLY },
406019Shines@cs.fsu.edu  { ArmLinux::TGT_O_WRONLY,	_O_WRONLY },
416019Shines@cs.fsu.edu  { ArmLinux::TGT_O_RDWR,	_O_RDWR },
426019Shines@cs.fsu.edu  { ArmLinux::TGT_O_APPEND,	_O_APPEND },
436019Shines@cs.fsu.edu  { ArmLinux::TGT_O_CREAT,	_O_CREAT },
446019Shines@cs.fsu.edu  { ArmLinux::TGT_O_TRUNC,	_O_TRUNC },
456019Shines@cs.fsu.edu  { ArmLinux::TGT_O_EXCL,	_O_EXCL },
466019Shines@cs.fsu.edu#ifdef _O_NONBLOCK
476019Shines@cs.fsu.edu  { ArmLinux::TGT_O_NONBLOCK,	_O_NONBLOCK },
486019Shines@cs.fsu.edu#endif
496019Shines@cs.fsu.edu#ifdef _O_NOCTTY
506019Shines@cs.fsu.edu  { ArmLinux::TGT_O_NOCTTY,	_O_NOCTTY },
516019Shines@cs.fsu.edu#endif
526019Shines@cs.fsu.edu#ifdef _O_SYNC
536019Shines@cs.fsu.edu  { ArmLinux::TGT_O_SYNC,	_O_SYNC },
546019Shines@cs.fsu.edu#endif
556019Shines@cs.fsu.edu#else /* !_MSC_VER */
566019Shines@cs.fsu.edu  { ArmLinux::TGT_O_RDONLY,	O_RDONLY },
576019Shines@cs.fsu.edu  { ArmLinux::TGT_O_WRONLY,	O_WRONLY },
586019Shines@cs.fsu.edu  { ArmLinux::TGT_O_RDWR,	O_RDWR },
597441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_CREAT,	O_CREAT },
607441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_EXCL,	O_EXCL },
617441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_NOCTTY,	O_NOCTTY },
627441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_TRUNC,	O_TRUNC },
636019Shines@cs.fsu.edu  { ArmLinux::TGT_O_APPEND,	O_APPEND },
646019Shines@cs.fsu.edu  { ArmLinux::TGT_O_NONBLOCK,	O_NONBLOCK },
656019Shines@cs.fsu.edu#ifdef O_SYNC
666019Shines@cs.fsu.edu  { ArmLinux::TGT_O_SYNC,	O_SYNC },
676019Shines@cs.fsu.edu#endif
687441SAli.Saidi@ARM.com#ifdef FASYNC
697441SAli.Saidi@ARM.com  { ArmLinux::TGT_FASYNC,	FASYNC },
707441SAli.Saidi@ARM.com#endif
717441SAli.Saidi@ARM.com#ifdef O_DIRECT
727441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_DIRECT,	O_DIRECT },
737441SAli.Saidi@ARM.com#endif
747441SAli.Saidi@ARM.com#ifdef O_LARGEFILE
757441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_LARGEFILE,	O_LARGEFILE },
767441SAli.Saidi@ARM.com#endif
777441SAli.Saidi@ARM.com#ifdef O_DIRECTORY
787441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_DIRECTORY,	O_DIRECTORY },
797441SAli.Saidi@ARM.com#endif
807441SAli.Saidi@ARM.com#ifdef O_NOFOLLOW
817441SAli.Saidi@ARM.com  { ArmLinux::TGT_O_NOFOLLOW,	O_NOFOLLOW },
827441SAli.Saidi@ARM.com#endif
836019Shines@cs.fsu.edu#endif /* _MSC_VER */
846019Shines@cs.fsu.edu};
856019Shines@cs.fsu.edu
866019Shines@cs.fsu.educonst int ArmLinux::NUM_OPEN_FLAGS =
876019Shines@cs.fsu.edu        (sizeof(ArmLinux::openFlagTable)/sizeof(ArmLinux::openFlagTable[0]));
886019Shines@cs.fsu.edu
89