linux.hh (9112:6e854ea87bab) linux.hh (9141:593fe25c86a6)
1/*
2 * Copyright (c) 2004-2009 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

142 };
143
144 // For writev/readv
145 struct tgt_iovec {
146 uint64_t iov_base; // void *
147 uint64_t iov_len;
148 };
149
1/*
2 * Copyright (c) 2004-2009 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

142 };
143
144 // For writev/readv
145 struct tgt_iovec {
146 uint64_t iov_base; // void *
147 uint64_t iov_len;
148 };
149
150 //@{
151 /// ioctl() command codes.
152 static const unsigned TGT_TCGETS = 0x5401;
153 static const unsigned TGT_TCGETA = 0x5405;
154 static const unsigned TGT_TCSETAW = 0x5407;
155 static const unsigned TGT_FIONREAD = 0x541B;
156 //@}
150
157
158 /// Return true for the ioctl codes for which we return ENOTTY
159 /// *without* printing a warning, since we know that ENOTTY is the
160 /// correct thing to return (and not just a sign that we don't
161 /// recognize the ioctl code.
162 static bool
163 isTtyReq(unsigned req)
164 {
165 switch (req) {
166 case TGT_FIONREAD:
167 case TGT_TCSETAW:
168 case TGT_TCGETS:
169 case TGT_TCGETA:
170 return true;
171 default:
172 return false;
173 }
174 }
175
176
151 /// For getrusage().
152 struct rusage {
153 struct timeval ru_utime; //!< user time used
154 struct timeval ru_stime; //!< system time used
155 int64_t ru_maxrss; //!< max rss
156 int64_t ru_ixrss; //!< integral shared memory size
157 int64_t ru_idrss; //!< integral unshared data "
158 int64_t ru_isrss; //!< integral unshared stack "

--- 24 unchanged lines hidden ---
177 /// For getrusage().
178 struct rusage {
179 struct timeval ru_utime; //!< user time used
180 struct timeval ru_stime; //!< system time used
181 int64_t ru_maxrss; //!< max rss
182 int64_t ru_ixrss; //!< integral shared memory size
183 int64_t ru_idrss; //!< integral unshared data "
184 int64_t ru_isrss; //!< integral unshared stack "

--- 24 unchanged lines hidden ---