3.0.19

From Msim

(Difference between revisions)
Jump to: navigation, search
(New page: This page refers to the changes made in the 3.0.19 release of M-sim.<br> <br> Release Date: <br> <br> == Syscalls == === osf_sys_lseek === osf_sys_lseek does not return -1 when called on...)
Line 3: Line 3:
Release Date: <br>
Release Date: <br>
<br>
<br>
 +
 +
== File Table ==
 +
* On fork, standard IO entries were not copied to the child thread. This is fixed (see copy_from: cur_entry.reserved & FE_STANDARD_IO).
 +
* closing standard IO file descriptors is now allowed (see closer) as long as they aren't STDIN/STDOUT/STDERR that belong to the simulator.
 +
* The FD_CLOEXEC flag is now handled (which also handles fcntl::getfd and fcntl::setfd).
 +
* The method for getting the lowest available file descriptor terminated too early (and could result in duplicate simulated file descriptors).
 +
* The file table now handles the determination of terminal (tty) status.
 +
* dup and dup2 now copy the FE_STANDARD_IO flag (they probably shouldn't copy FD_CLOEXEC though).
 +
* insert now returns the file descriptor provided (it used to always give the same one as asked for but this isn't always possible).
 +
 +
 +
== Syscalls ==
== Syscalls ==

Revision as of 22:22, 18 July 2010

This page refers to the changes made in the 3.0.19 release of M-sim.

Release Date:

File Table

  • On fork, standard IO entries were not copied to the child thread. This is fixed (see copy_from: cur_entry.reserved & FE_STANDARD_IO).
  • closing standard IO file descriptors is now allowed (see closer) as long as they aren't STDIN/STDOUT/STDERR that belong to the simulator.
  • The FD_CLOEXEC flag is now handled (which also handles fcntl::getfd and fcntl::setfd).
  • The method for getting the lowest available file descriptor terminated too early (and could result in duplicate simulated file descriptors).
  • The file table now handles the determination of terminal (tty) status.
  • dup and dup2 now copy the FE_STANDARD_IO flag (they probably shouldn't copy FD_CLOEXEC though).
  • insert now returns the file descriptor provided (it used to always give the same one as asked for but this isn't always possible).



Syscalls

osf_sys_lseek

osf_sys_lseek does not return -1 when called on stdin, stdout or stderr on Tru64. Empirically, it appears to output the total number of characters printed for the current session.

#include <sys/types.h>
#include <unistd.h>
#include <iostream>

int main()
{
       cout << "Weeee!" << endl;
       for(int i=0;i<10;i++)
       {
               off_t sval = lseek(i,0,1);
               cout << i << ":  " << sval << endl;
       }
       return 0;
}

On a new session:

jloew@tru64:~/syscall$ ./a.out
Weeee!
0:  722
1:  730
2:  738
3:  -1
4:  -1
5:  -1
6:  -1
7:  -1
8:  -1
9:  -1

Second execution:

jloew@tru64:~/syscall$ ./a.out
Weeee!
0:  864
1:  872
2:  880
3:  -1
4:  -1
5:  -1
6:  -1
7:  -1
8:  -1
9:  -1

The difference is consistent (typing into the command prompt and deleting it will increase this counter).

Personal tools