Port code for duplicated fd's detection from old version.
This is nessesary for detection of following scenarios:

test_fd_lauch.c:

#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

int main()
{
	int tmp, fd1, fd2, i;
	
	tmp = open("test",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
	fd1 = dup2(tmp,100);
	fd2 = dup2(fd1,101);
	close(tmp);

	execlp("dmtcp_checkpoint","dmtcp_checkpoint","./test_fd",NULL);
}

test_fd.c
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>

int main()
{
	int fd1, fd2,i;
	
	fd1 = 100;
	fd2 = 101;
	
	for(i=0;i<1000000;i++){
		char s[256];
		sprintf(s,"%d(1) ",i);
		write(fd1,s,strlen(s));
		sprintf(s,"%d(2) ",i);
		write(fd2,s,strlen(s));
		sleep(1);
	}
	close(fd1);
	close(fd2);
}



git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1802 ba6dc0ae-232f-0410-883f-9ebac64fc565
- It now works to to define the SETJMP conditional in MTCP.  This used to
    fail on i386/x86-64 because setjmp did pointer mangling while setcontext
    did not.  On arm, only setjmp was available, and it did not do pointer
    mangling.  So, we were using setjmp on arm, and setcontext otherwise.
    The new code directly copies the stack pointer and uses it on restart to
    create a temporary stack area.  MTCP now no longer executes the fragile
    code that tried to recover the stack pointer from the setjmp
    internal struct.


git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1803 ba6dc0ae-232f-0410-883f-9ebac64fc565
Fix for Intel icc/icpc compilers.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1804 ba6dc0ae-232f-0410-883f-9ebac64fc565
Minor fix for rev 1804.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1805 ba6dc0ae-232f-0410-883f-9ebac64fc565
Torque support related fixes:

1. Fix tm_spawn agrument list processing (one last was erroneously ignored)
2. Fix deleted files handling. Update connection _path before checking (deleted) suffix!



git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1806 ba6dc0ae-232f-0410-883f-9ebac64fc565
Minor fix related to blacklisted files.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1807 ba6dc0ae-232f-0410-883f-9ebac64fc565
Bugfix for Connection Plugin.

Detect duplicate fds and delete the Connection object associated with
previous fd.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1808 ba6dc0ae-232f-0410-883f-9ebac64fc565
More verbosive connection debug



git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1809 ba6dc0ae-232f-0410-883f-9ebac64fc565
Fix Torque node file restore 



git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1810 ba6dc0ae-232f-0410-883f-9ebac64fc565
MTCP: Bugfix for getting libmtcp.so memory region.

On some systems, memory regions corresponding to rodata, rwdata, and bssdata
have execute permission as well. Changing to code to not assert.


git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1811 ba6dc0ae-232f-0410-883f-9ebac64fc565
JALIB: Initialization bugfix.

If jalib::_real_XXX functions are called before jalib_init() has been called, make an explicit call to initializeJalib() function.


git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1812 ba6dc0ae-232f-0410-883f-9ebac64fc565
Fix restart of distributed application. using getsockname for the listen socket will 
not return IP addres of the host. Instead "0.0.0.0" will be returned.
This information was used at restart time for NS service and thus restore of connection
to remote caused "Connection refused" error.

This fix assumes that communication with coordinator is performed through the same IP 
address (and thus Ethernet device) as all other connections.
On clusters this assumption may be incorrect. There may be service network that is ok
for coordinator communicatiuons and computational network (that is usually faster) that
is dedicated for parallel process communication.
In future we can provide an option that will provide preferred address for network interface
that should be used for communication.



git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1813 ba6dc0ae-232f-0410-883f-9ebac64fc565
In torque.cpp, replace mktemp by mkstemp.  (mktemp is not POSIX.)


git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1814 ba6dc0ae-232f-0410-883f-9ebac64fc565
Typo in 1801 fixed.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1815 ba6dc0ae-232f-0410-883f-9ebac64fc565
Bug fixes for SharedData.

- Increase coordinator time resolution to 100ms. Otherwise, for
subsequent restarts, the coordinator timestamp has the same value
causing conflict with SharedData file. In future, the file associated
with SharedData should be deleted in preCkpt phase and recreated in
postCkpt/postRestart phases.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1816 ba6dc0ae-232f-0410-883f-9ebac64fc565
ConnPlugin: Added wrappers for tmpfile/mkstemp etc.


git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1817 ba6dc0ae-232f-0410-883f-9ebac64fc565
Bugfix for PTYs and SharedData

nextVirtualPtyId was reset to 0 in each child process causing
/dev/pts/v0 to be assigned to multiple separate ptys. This patch fixes
this problem by moving nextVirtualPtyId into SharedData header.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1818 ba6dc0ae-232f-0410-883f-9ebac64fc565
Bug fix for autotest.py.

git-svn-id: https://dmtcp.svn.sourceforge.net/svnroot/dmtcp/trunk@1819 ba6dc0ae-232f-0410-883f-9ebac64fc565