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 "base/output.hh" |
47#include "params/Process.hh" 48#include "sim/fd_entry.hh" 49 50FDArray::FDArray(std::string const& input, std::string const& output, 51 std::string const& errout) 52 : _fdArray(), _input(input), _output(output), _errout(errout), 53 _imap {{"", -1}, 54 {"cin", STDIN_FILENO}, --- 252 unchanged lines hidden (view full) --- 307FDArray::openInputFile(std::string const& filename) const 308{ 309 return openFile(filename, O_RDONLY, 00); 310} 311 312int 313FDArray::openOutputFile(std::string const& filename) const 314{ |
315 return openFile(simout.resolve(filename), 316 O_WRONLY | O_CREAT | O_TRUNC, 0664); |
317} 318 319std::shared_ptr<FDEntry> 320FDArray::getFDEntry(int tgt_fd) 321{ 322 assert(0 <= tgt_fd && tgt_fd < _fdArray.size()); 323 return _fdArray[tgt_fd]; 324} --- 28 unchanged lines hidden --- |