Deleted Added
sdiff udiff text old ( 13029:75abda747dc3 ) new ( 13897:0388bc4e1c61 )
full compact
1/*
2 * Copyright (c) 2016 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * For use for simulation and test purposes only
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:

--- 29 unchanged lines hidden (view full) ---

38#include <fcntl.h>
39#include <unistd.h>
40
41#include <array>
42#include <memory>
43#include <string>
44
45#include "base/logging.hh"
46#include "params/Process.hh"
47#include "sim/fd_entry.hh"
48
49FDArray::FDArray(std::string const& input, std::string const& output,
50 std::string const& errout)
51 : _fdArray(), _input(input), _output(output), _errout(errout),
52 _imap {{"", -1},
53 {"cin", STDIN_FILENO},

--- 252 unchanged lines hidden (view full) ---

306FDArray::openInputFile(std::string const& filename) const
307{
308 return openFile(filename, O_RDONLY, 00);
309}
310
311int
312FDArray::openOutputFile(std::string const& filename) const
313{
314 return openFile(filename, O_WRONLY | O_CREAT | O_TRUNC, 0664);
315}
316
317std::shared_ptr<FDEntry>
318FDArray::getFDEntry(int tgt_fd)
319{
320 assert(0 <= tgt_fd && tgt_fd < _fdArray.size());
321 return _fdArray[tgt_fd];
322}

--- 28 unchanged lines hidden ---