6 #include "ns3/assert.h"
36 NS_LOG_FUNCTION (
this << current << buf << count);
37 NS_ASSERT (current != 0);
38 ssize_t result = ::write (
m_realFd, buf, count);
49 NS_LOG_FUNCTION (
this << current << buf << count);
50 NS_ASSERT (current != 0);
51 ssize_t result = ::read (
m_realFd, buf, count);
63 NS_LOG_FUNCTION (
this << current);
64 NS_ASSERT (current != 0);
65 current->
err = ENOTSOCK;
72 NS_LOG_FUNCTION (
this << current);
73 NS_ASSERT (current != 0);
74 current->
err = ENOTSOCK;
84 const void *optval, socklen_t optlen)
87 NS_LOG_FUNCTION (
this << current);
88 NS_ASSERT (current != 0);
89 current->
err = ENOTSOCK;
94 void *optval, socklen_t *optlen)
97 NS_LOG_FUNCTION (
this << current);
98 NS_ASSERT (current != 0);
99 current->
err = ENOTSOCK;
106 NS_LOG_FUNCTION (
this << current << name << *namelen);
107 NS_ASSERT (current != 0);
108 current->
err = ENOTSOCK;
115 NS_LOG_FUNCTION (
this << current << name << *namelen);
116 NS_ASSERT (current != 0);
117 current->
err = ENOTSOCK;
125 NS_LOG_FUNCTION (
this << current);
126 NS_ASSERT (current != 0);
127 current->
err = EINVAL;
134 NS_LOG_FUNCTION (
this << current);
135 NS_ASSERT (current != 0);
136 current->
err = ENOTSOCK;
143 NS_LOG_FUNCTION (
this << current);
144 NS_ASSERT (current != 0);
145 current->
err = ENOTSOCK;
152 NS_LOG_FUNCTION (
this << current);
153 NS_ASSERT (current != 0);
154 current->
err = ENOTSOCK;
161 NS_LOG_FUNCTION (
this << current << my_addr << addrlen);
162 NS_ASSERT (current != 0);
163 current->
err = ENOTSOCK;
170 NS_LOG_FUNCTION (
this << current << how);
171 NS_ASSERT (current != 0);
172 current->
err = ENOTSOCK;
180 NS_LOG_FUNCTION (
this << current);
181 NS_ASSERT (current != 0);
183 void *retval = ::mmap (start, length, prot, flags,
m_realFd, offset);
194 NS_LOG_FUNCTION (
this << current << offset << whence);
195 NS_ASSERT (current != 0);
196 off64_t retval = ::lseek64 (
m_realFd, offset, whence);
207 NS_LOG_FUNCTION (
this << current << buf);
208 NS_ASSERT (current != 0);
209 int retval = ::__fxstat (ver,
m_realFd, buf);
220 NS_LOG_FUNCTION (
this << current << buf);
221 NS_ASSERT (current != 0);
222 int retval = ::__fxstat64 (ver,
m_realFd, buf);
232 NS_LOG_FUNCTION (
this <<
Current () << cmd << arg);
235 int retval = ::fcntl (
m_realFd, cmd, arg);
244 const struct itimerspec *new_value,
245 struct itimerspec *old_value)
247 NS_LOG_FUNCTION (
this <<
Current () << flags << new_value << old_value);
250 current->
err = EINVAL;
256 NS_LOG_FUNCTION (
this <<
Current () << cur_value);
259 current->
err = EINVAL;
267 NS_LOG_FUNCTION (
this <<
" fd:" <<
m_realFd);
270 struct timeval timeOut;
278 ret = select (1 +
m_realFd, &readFd, NULL, NULL, &timeOut);
280 return (ret == 1) && (FD_ISSET (
m_realFd, &readFd));
285 NS_LOG_FUNCTION (
this <<
" fd:" <<
m_realFd);
288 struct timeval timeOut;
296 ret = select (1 +
m_realFd, &writeFd, NULL, NULL, &timeOut);
298 return (ret == 1) && (FD_ISSET (
m_realFd, &writeFd));
310 NS_ASSERT (current != 0);
311 NS_LOG_FUNCTION (
this << current << length);
313 int retval = ::ftruncate (
m_realFd, length);
341 NS_LOG_FUNCTION (
this << current);
342 NS_ASSERT (current != 0);
393 FILE *f = fopen (
m_path.c_str (),
"a");
401 ssize_t res = fwrite (buf, count, 1, f);
447 NS_ASSERT (0 != nodeContext);
449 return nodeContext->RandomRead (buf, count);
472 NS_ASSERT (current != 0);
473 current->
err = EBADF;
481 NS_LOG_FUNCTION (
this << current << buf);
482 int tmpFd = open (
m_devPath.c_str (), O_RDONLY, 0);
490 NS_ASSERT (current != 0);
491 int retval = ::__fxstat (ver, tmpFd, buf);
503 NS_LOG_FUNCTION (
this << current << buf);
504 int tmpFd = open (
m_devPath.c_str (), O_RDONLY, 0);
512 NS_ASSERT (current != 0);
513 int retval = ::__fxstat64 (ver, tmpFd, buf);