summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityam@microsoft.com>2015-11-03 11:56:28 -0800
committerAditya Mandaleeka <adityam@microsoft.com>2015-11-03 11:56:28 -0800
commit3cc84c569f6f2e057599ca05d6899eec541fa3bf (patch)
treeae0740de89e18463a595858ff654d053d86e7a0a /src/pal
parentc76b7d964f35ec44f87f0be50b7b1fb691efa5f4 (diff)
downloadcoreclr-3cc84c569f6f2e057599ca05d6899eec541fa3bf.tar.gz
coreclr-3cc84c569f6f2e057599ca05d6899eec541fa3bf.tar.bz2
coreclr-3cc84c569f6f2e057599ca05d6899eec541fa3bf.zip
Remove thread parameter from file-related functions
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/src/cruntime/filecrt.cpp79
-rw-r--r--src/pal/src/cruntime/printfcpp.cpp8
-rw-r--r--src/pal/src/debug/debug.cpp6
-rw-r--r--src/pal/src/file/file.cpp26
-rw-r--r--src/pal/src/include/pal/file.h3
-rw-r--r--src/pal/src/include/pal/file.hpp50
-rw-r--r--src/pal/src/map/map.cpp11
-rw-r--r--src/pal/src/misc/dbgmsg.cpp4
-rw-r--r--src/pal/src/synchmgr/synchmanager.cpp12
9 files changed, 73 insertions, 126 deletions
diff --git a/src/pal/src/cruntime/filecrt.cpp b/src/pal/src/cruntime/filecrt.cpp
index f7cc20f592..2d407d87ec 100644
--- a/src/pal/src/cruntime/filecrt.cpp
+++ b/src/pal/src/cruntime/filecrt.cpp
@@ -96,7 +96,7 @@ _open_osfhandle( INT_PTR osfhandle, int flags )
{
if ('\0' != pLocalData->unix_filename[0])
{
- nRetVal = InternalOpen(pthrCurrent, pLocalData->unix_filename, openFlags);
+ nRetVal = InternalOpen(pLocalData->unix_filename, openFlags);
}
else /* the only file object with no unix_filename is a pipe */
{
@@ -153,7 +153,7 @@ PAL_fflush( PAL_FILE *stream )
PERF_ENTRY(fflush);
ENTRY( "fflush( %p )\n", stream );
- nRetVal = InternalFflush(InternalGetCurrentThread(), stream ? stream->bsdFilePtr : NULL);
+ nRetVal = InternalFflush(stream ? stream->bsdFilePtr : NULL);
LOGEXIT( "fflush returning %d\n", nRetVal );
PERF_EXIT(fflush);
@@ -178,7 +178,6 @@ should not be suspended while inside it.
--*/
int
CorUnix::InternalFflush(
- CPalThread *pthrCurrent,
FILE *stream
)
{
@@ -209,7 +208,7 @@ PAL__getcwd(
size_t nSize
)
{
- return InternalGetcwd(InternalGetCurrentThread(), szBuf, nSize);
+ return InternalGetcwd(szBuf, nSize);
}
@@ -231,7 +230,6 @@ Return value:
--*/
char *
CorUnix::InternalGetcwd(
- CPalThread *pthrCurrent,
char *szBuf,
size_t nSize
)
@@ -267,20 +265,16 @@ int
__cdecl
PAL_mkstemp(char *szNameTemplate)
{
- return InternalMkstemp(InternalGetCurrentThread(), szNameTemplate);
+ return InternalMkstemp(szNameTemplate);
}
/*++
InternalMkstemp
-Wrapper for mkstemp. mkstemp may invoke malloc, in which case a thread
-suspended inside it could be holding an internal lock. This function prevents
-such a suspension from occuring by ensuring that a thread cannot be suspended
-while inside mkstemp.
+Wrapper for mkstemp.
Input parameters:
-pthrCurrent = reference to executing thread
szNameTemplate = template to follow when naming the created file
Return value:
@@ -288,7 +282,6 @@ Return value:
--*/
int
CorUnix::InternalMkstemp(
- CPalThread *pthrCurrent,
char *szNameTemplate
)
{
@@ -336,21 +329,17 @@ PAL__open(
va_end(ap);
}
- nRet = InternalOpen(InternalGetCurrentThread(), szPath, nFlags, mode);
+ nRet = InternalOpen(szPath, nFlags, mode);
return nRet;
}
/*++
InternalOpen
-Wrapper for open. open can take a internal file lock, in which case a thread
-suspended inside it could be holding an internal lock. This function prevents
-such a suspension from occuring by ensuring that a thread cannot be suspended
-while inside open.
+Wrapper for open.
Input parameters:
-pthrCurrent = reference to executing thread
szPath = pointer to a pathname of a file to be opened
nFlags = arguments that control how the file should be accessed
mode = file permission settings that are used only when a file is created
@@ -360,7 +349,6 @@ Return value:
--*/
int
CorUnix::InternalOpen(
- CPalThread *pthrCurrent,
const char *szPath,
int nFlags,
...
@@ -403,20 +391,16 @@ int
__cdecl
PAL_unlink(const char *szPath)
{
- return InternalUnlink(InternalGetCurrentThread(), szPath);
+ return InternalUnlink(szPath);
}
/*++
InternalUnlink
-Wrapper for unlink. unlink can take a internal file lock, in which case a thread
-suspended inside it could be holding an internal lock. This function prevents
-such a suspension from occuring by ensuring that a thread cannot be suspended
-while inside unlink.
+Wrapper for unlink.
Input parameters:
-pthrCurrent = reference to executing thread
szPath = a symbolic link or a hard link to a file
Return value:
@@ -424,7 +408,6 @@ Return value:
--*/
int
CorUnix::InternalUnlink(
- CPalThread *pthrCurrent,
const char *szPath
)
{
@@ -442,7 +425,6 @@ it uses the SYS_Delete system call present on Apple instead of unlink.
Input parameters:
-pthrCurrent = reference to executing thread
szPath = a symbolic link or a hard link to a file
Return value:
@@ -450,7 +432,6 @@ Return value:
--*/
int
CorUnix::InternalDeleteFile(
- CPalThread *pthrCurrent,
const char *szPath
)
{
@@ -484,20 +465,16 @@ PAL_rename(
const char *szNewName
)
{
- return InternalRename(InternalGetCurrentThread(), szOldName, szNewName);
+ return InternalRename(szOldName, szNewName);
}
/*++
InternalRename
-Wrapper for rename. rename can take a internal file lock, in which case a thread
-suspended inside it could be holding an internal lock. This function prevents
-such a suspension from occuring by ensuring that a thread cannot be suspended
-while inside rename.
+Wrapper for rename.
Input parameters:
-pthrCurrent = reference to executing thread
szOldName = pointer to the pathname of the file to be renamed
szNewName = pointer to the new pathname of the file
@@ -506,7 +483,6 @@ Return value:
--*/
int
CorUnix::InternalRename(
- CPalThread *pthrCurrent,
const char *szOldName,
const char *szNewName
)
@@ -546,7 +522,7 @@ PAL_fgets(
if (pf != NULL)
{
- szBuf = InternalFgets(InternalGetCurrentThread(), sz, nSize, pf->bsdFilePtr, pf->bTextMode);
+ szBuf = InternalFgets(sz, nSize, pf->bsdFilePtr, pf->bTextMode);
}
else
{
@@ -562,14 +538,10 @@ PAL_fgets(
/*++
InternalFgets
-Wrapper for fgets. fgets can take a internal file lock, in which case a thread
-suspended inside it could be holding an internal lock. This function prevents
-such a suspension from occuring by ensuring that a thread cannot be suspended
-while inside fgets.
+Wrapper for fgets.
Input parameters:
-pthrCurrent = reference to executing thread
sz = stores characters read from the given file stream
nSize = number of characters to be read
f = stream to read characters from
@@ -586,7 +558,6 @@ happens, it is SOP to call fgets again.
--*/
char *
CorUnix::InternalFgets(
- CPalThread *pthrCurrent,
char *sz,
int nSize,
FILE *f,
@@ -670,7 +641,7 @@ PAL_fwrite(
pvBuffer, nSize, nCount, pf);
_ASSERTE(pf != NULL);
- nWrittenBytes = InternalFwrite(InternalGetCurrentThread(), pvBuffer, nSize, nCount, pf->bsdFilePtr, &pf->PALferrorCode);
+ nWrittenBytes = InternalFwrite(pvBuffer, nSize, nCount, pf->bsdFilePtr, &pf->PALferrorCode);
LOGEXIT( "fwrite returning size_t %d\n", nWrittenBytes );
PERF_EXIT(fwrite);
@@ -680,14 +651,10 @@ PAL_fwrite(
/*++
InternalFwrite
-Wrapper for fwrite. fwrite can take a internal file lock, in which case a thread
-suspended inside it could be holding an internal lock. This function prevents
-such a suspension from occuring by ensuring that a thread cannot be suspended
-while inside fwrite.
+Wrapper for fwrite.
Input parameters:
-pthrCurrent = reference to executing thread
pvBuffer = array of objects to write to the given file stream
nSize = size of a object in bytes
nCount = number of objects to write
@@ -699,10 +666,9 @@ Return value:
--*/
size_t
CorUnix::InternalFwrite(
- CPalThread *pthrCurrent,
- const void *pvBuffer,
- size_t nSize,
- size_t nCount,
+ const void *pvBuffer,
+ size_t nSize,
+ size_t nCount,
FILE *f,
INT *pnErrorCode
)
@@ -754,7 +720,7 @@ PAL_fseek(
PERF_ENTRY(fseek);
ENTRY( "fseek( %p, %ld, %d )\n", pf, lOffset, nWhence );
- nRet = InternalFseek(InternalGetCurrentThread(), pf ? pf->bsdFilePtr : NULL, lOffset, nWhence);
+ nRet = InternalFseek(pf ? pf->bsdFilePtr : NULL, lOffset, nWhence);
LOGEXIT("fseek returning %d\n", nRet);
PERF_EXIT(fseek);
@@ -764,14 +730,10 @@ PAL_fseek(
/*++
InternalFseek
-Wrapper for fseek. fseek can take a internal file lock, in which case a thread
-suspended inside it could be holding an internal lock. This function prevents
-such a suspension from occuring by ensuring that a thread cannot be suspended
-while inside fseek.
+Wrapper for fseek.
Input parameters:
-pthrCurrent = reference to executing thread
f = a given file stream
lOffset = distance from position to set file-position indicator
nWhence = method used to determine the file_position indicator location relative to lOffset
@@ -781,7 +743,6 @@ Return value:
--*/
int
CorUnix::InternalFseek(
- CPalThread *pthrCurrent,
FILE *f,
long lOffset,
int nWhence
diff --git a/src/pal/src/cruntime/printfcpp.cpp b/src/pal/src/cruntime/printfcpp.cpp
index 4114061d7d..24a12d3e95 100644
--- a/src/pal/src/cruntime/printfcpp.cpp
+++ b/src/pal/src/cruntime/printfcpp.cpp
@@ -84,7 +84,7 @@ static int Internal_Convertfwrite(CPalThread *pthrCurrent, const void *buffer, s
InternalFree(newBuff);
return -1;
}
- ret = InternalFwrite(pthrCurrent, newBuff, 1, count, stream, &iError);
+ ret = InternalFwrite(newBuff, 1, count, stream, &iError);
if (iError != 0)
{
ERROR("InternalFwrite did not write the whole buffer. Error is %d\n", iError);
@@ -95,7 +95,7 @@ static int Internal_Convertfwrite(CPalThread *pthrCurrent, const void *buffer, s
}
else
{
- ret = InternalFwrite(pthrCurrent, buffer, size, count, stream, &iError);
+ ret = InternalFwrite(buffer, size, count, stream, &iError);
if (iError != 0)
{
ERROR("InternalFwrite did not write the whole buffer. Error is %d\n", iError);
@@ -941,7 +941,7 @@ INT Internal_AddPaddingVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, LPSTR
clearerr (stream->bsdFilePtr);
#endif
- Written = InternalFwrite(pthrCurrent, OutOriginal, 1, Length, stream->bsdFilePtr, &stream->PALferrorCode);
+ Written = InternalFwrite(OutOriginal, 1, Length, stream->bsdFilePtr, &stream->PALferrorCode);
if (stream->PALferrorCode == PAL_FILE_ERROR)
{
ERROR("fwrite() failed with errno == %d\n", errno);
@@ -2542,7 +2542,7 @@ int CoreVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const char *format,
clearerr (stream->bsdFilePtr);
#endif
- InternalFwrite(pthrCurrent, Fmt++, 1, 1, stream->bsdFilePtr, &stream->PALferrorCode); /* copy regular chars into buffer */
+ InternalFwrite(Fmt++, 1, 1, stream->bsdFilePtr, &stream->PALferrorCode); /* copy regular chars into buffer */
if (stream->PALferrorCode == PAL_FILE_ERROR)
{
ERROR("fwrite() failed with errno == %d\n", errno);
diff --git a/src/pal/src/debug/debug.cpp b/src/pal/src/debug/debug.cpp
index 48d54fdda1..6a09e84fb1 100644
--- a/src/pal/src/debug/debug.cpp
+++ b/src/pal/src/debug/debug.cpp
@@ -682,7 +682,7 @@ ReadProcessMemory(
#else // HAVE_VM_READ
#if HAVE_PROCFS_CTL
snprintf(memPath, sizeof(memPath), "/proc/%u/%s", processId, PROCFS_MEM_NAME);
- fd = InternalOpen(pThread, memPath, O_RDONLY);
+ fd = InternalOpen(memPath, O_RDONLY);
if (fd == -1)
{
ERROR("Failed to open %s\n", memPath);
@@ -957,7 +957,7 @@ WriteProcessMemory(
#else // HAVE_VM_READ
#if HAVE_PROCFS_CTL
snprintf(memPath, sizeof(memPath), "/proc/%u/%s", processId, PROCFS_MEM_NAME);
- fd = InternalOpen(pThread, memPath, O_WRONLY);
+ fd = InternalOpen(memPath, O_WRONLY);
if (fd == -1)
{
ERROR("Failed to open %s\n", memPath);
@@ -1280,7 +1280,7 @@ DBGAttachProcess(
nanosleep(&waitTime, NULL);
sprintf_s(ctlPath, sizeof(ctlPath), "/proc/%d/ctl", processId);
- fd = InternalOpen(pThread, ctlPath, O_WRONLY);
+ fd = InternalOpen(ctlPath, O_WRONLY);
if (fd == -1)
{
ERROR("Failed to open %s: errno is %d (%s)\n", ctlPath,
diff --git a/src/pal/src/file/file.cpp b/src/pal/src/file/file.cpp
index d3953e5e87..c8d2945271 100644
--- a/src/pal/src/file/file.cpp
+++ b/src/pal/src/file/file.cpp
@@ -246,12 +246,12 @@ InternalCanonicalizeRealPath
realpath() requires the buffer to be atleast PATH_MAX).
--*/
PAL_ERROR
-CorUnix::InternalCanonicalizeRealPath(CPalThread *pThread, LPCSTR lpUnixPath, LPSTR lpBuffer, DWORD cch)
+CorUnix::InternalCanonicalizeRealPath(LPCSTR lpUnixPath, LPSTR lpBuffer, DWORD cch)
{
PAL_ERROR palError = NO_ERROR;
LPSTR lpRealPath = NULL;
-#if !REALPATH_SUPPORTS_NONEXISTENT_FILES
+#if !REALPATH_SUPPORTS_NONEXISTENT_FILES
LPSTR lpExistingPath = NULL;
LPSTR pchSeparator = NULL;
LPSTR lpFilename = NULL;
@@ -284,7 +284,7 @@ CorUnix::InternalCanonicalizeRealPath(CPalThread *pThread, LPCSTR lpUnixPath, LP
char pszCwdBuffer[MAXPATHLEN+1]; // MAXPATHLEN is for getcwd()
DWORD cchCwdBuffer = sizeof(pszCwdBuffer)/sizeof(pszCwdBuffer[0]);
- if (InternalGetcwd(pThread, pszCwdBuffer, cchCwdBuffer) == NULL)
+ if (InternalGetcwd(pszCwdBuffer, cchCwdBuffer) == NULL)
{
WARN("InternalGetcwd(NULL) failed with error %d\n", errno);
palError = DIRGetLastErrorFromErrno();
@@ -484,8 +484,8 @@ CorUnix::InternalCreateFile(
const char* szNonfilePrefix = "\\\\.\\";
LPSTR lpFullUnixPath = NULL;
- DWORD cchFullUnixPath = PATH_MAX+1;// InternalCanonicalizeRealPath requires this to be atleast PATH_MAX
-
+ DWORD cchFullUnixPath = PATH_MAX+1; // InternalCanonicalizeRealPath requires this to be atleast PATH_MAX
+
/* for dwShareMode only three flags are accepted */
if ( dwShareMode & ~(FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE) )
{
@@ -539,7 +539,7 @@ CorUnix::InternalCreateFile(
// Compute the absolute pathname to the file. This pathname is used
// to determine if two file names represent the same file.
- palError = InternalCanonicalizeRealPath(pThread, lpUnixPath, lpFullUnixPath, cchFullUnixPath);
+ palError = InternalCanonicalizeRealPath(lpUnixPath, lpFullUnixPath, cchFullUnixPath);
if (palError != NO_ERROR)
{
goto done;
@@ -692,7 +692,7 @@ CorUnix::InternalCreateFile(
TRACE("I/O will be buffered\n");
}
- filed = InternalOpen(pThread, lpUnixPath, open_flags, create_flags);
+ filed = InternalOpen(lpUnixPath, open_flags, create_flags);
TRACE("Allocated file descriptor [%d]\n", filed);
if ( filed < 0 )
@@ -842,7 +842,7 @@ done:
}
if (bFileCreated)
{
- if (-1 == InternalUnlink(pThread, lpUnixPath))
+ if (-1 == InternalUnlink(lpUnixPath))
{
WARN("can't delete file; unlink() failed with errno %d (%s)\n",
errno, strerror(errno));
@@ -1216,7 +1216,7 @@ DeleteFileA(
// Compute the absolute pathname to the file. This pathname is used
// to determine if two file names represent the same file.
- palError = InternalCanonicalizeRealPath(pThread, lpUnixFileName, lpFullUnixFileName, cchFullUnixFileName);
+ palError = InternalCanonicalizeRealPath(lpUnixFileName, lpFullUnixFileName, cchFullUnixFileName);
if (palError != NO_ERROR)
{
InternalFree(lpFullUnixFileName);
@@ -1246,11 +1246,11 @@ DeleteFileA(
dwShareMode != SHARE_MODE_NOT_INITALIZED &&
(dwShareMode & FILE_SHARE_DELETE) != 0)
{
- result = InternalUnlink( pThread, lpFullUnixFileName );
+ result = InternalUnlink( lpFullUnixFileName );
}
else
{
- result = InternalDeleteFile( pThread, lpFullUnixFileName );
+ result = InternalDeleteFile( lpFullUnixFileName );
}
if ( result < 0 )
@@ -1497,7 +1497,7 @@ MoveFileExA(
}
}
- result = InternalRename( pThread, source, dest );
+ result = InternalRename( source, dest );
if ((result < 0) && (dwFlags & MOVEFILE_REPLACE_EXISTING) &&
((errno == ENOTDIR) || (errno == EEXIST)))
{
@@ -1505,7 +1505,7 @@ MoveFileExA(
if ( bRet )
{
- result = InternalRename( pThread, source, dest );
+ result = InternalRename( source, dest );
}
else
{
diff --git a/src/pal/src/include/pal/file.h b/src/pal/src/include/pal/file.h
index ee4dcb231d..8d9331dfc0 100644
--- a/src/pal/src/include/pal/file.h
+++ b/src/pal/src/include/pal/file.h
@@ -221,8 +221,7 @@ int _cdecl PAL_fflush( PAL_FILE *stream );
/*++
PAL_mkstemp
-Calls InternalMkstemp to call mkstemp with a thread that is marked
-as suspension unsafe.
+Calls InternalMkstemp to call mkstemp
Input parameters:
diff --git a/src/pal/src/include/pal/file.hpp b/src/pal/src/include/pal/file.hpp
index 0b7d4cd475..0214c9e902 100644
--- a/src/pal/src/include/pal/file.hpp
+++ b/src/pal/src/include/pal/file.hpp
@@ -42,11 +42,11 @@ namespace CorUnix
int unix_fd;
DWORD dwDesiredAccess; /* Unix assumes files are always opened for reading.
- In Windows we can open a file for writing only */
+ In Windows we can open a file for writing only */
int open_flags; /* stores Unix file creation flags */
BOOL open_flags_deviceaccessonly;
char unix_filename[MAXPATHLEN];
- BOOL inheritable;
+ BOOL inheritable;
};
PAL_ERROR
@@ -180,82 +180,73 @@ namespace CorUnix
--*/
PAL_ERROR
InternalCanonicalizeRealPath(
- CPalThread *pThread,
LPCSTR lpUnixPath,
LPSTR lpBuffer,
DWORD cch
- );
+ );
/*++
- InternalGetcwd
- Wraps getcwd so the thread calling it can't be suspended holding an internal lock.
+ InternalGetcwd
+ Wraps getcwd
--*/
char *
InternalGetcwd(
- CPalThread *pthrCurrent,
char *szBuf,
size_t nSize
);
/*++
- InternalFflush
- Wraps fflush so the thread calling it can't be suspended holding an internal lock.
+ InternalFflush
+ Wraps fflush
--*/
int
InternalFflush(
- CPalThread *pthrCurrent,
FILE * stream
);
/*++
- InternalMkstemp
- Wraps mkstemp so the thread calling it can't be suspended holding an internal lock.
+ InternalMkstemp
+ Wraps mkstemp
--*/
int
InternalMkstemp(
- CPalThread *pthrCurrent,
char *szNameTemplate
);
/*++
InternalUnlink
- Wraps unlink so the thread calling it can't be suspended holding an internal lock.
+ Wraps unlink
--*/
int
InternalUnlink(
- CPalThread *pthrCurrent,
const char *szPath
);
-
/*++
InternalDeleteFile
- Wraps SYS_delete so the thread calling it can't be suspended holding an internal lock.
+ Wraps SYS_delete
--*/
int
InternalDeleteFile(
- CPalThread *pthrCurrent,
const char *szPath
);
/*++
InternalRename
- Wraps rename so the thread calling it can't be suspended holding an internal lock.
+ Wraps rename
--*/
int
InternalRename(
- CPalThread *pthrCurrent,
const char *szOldName,
const char *szNewName
);
/*++
InternalFgets
- Wraps fgets so the thread calling it can't be suspended holding an internal lock.
+ Wraps fgets
--*/
char *
InternalFgets(
- CPalThread *pthrCurrent,
char *sz,
int nSize,
FILE *f,
@@ -264,25 +255,23 @@ namespace CorUnix
/*++
InternalFwrite
- Wraps fwrite so the thread calling it can't be suspended holding an internal lock.
+ Wraps fwrite
--*/
size_t
InternalFwrite(
- CPalThread *pthrCurrent,
- const void *pvBuffer,
- size_t nSize,
- size_t nCount,
+ const void *pvBuffer,
+ size_t nSize,
+ size_t nCount,
FILE *f,
INT *pnErrorCode
);
/*++
InternalOpen
- Wraps open so the thread calling it can't be suspended holding an internal lock.
+ Wraps open
--*/
int
InternalOpen(
- CPalThread *pthrCurrent,
const char *szFilename,
int nFlags,
...
@@ -290,11 +279,10 @@ namespace CorUnix
/*++
InternalFseek
- Wraps fseek so the thread calling it can't be suspended holding an internal lock.
+ Wraps fseek
--*/
int
InternalFseek(
- CPalThread *pthrCurrent,
FILE *f,
long lOffset,
int nWhence
diff --git a/src/pal/src/map/map.cpp b/src/pal/src/map/map.cpp
index 1bc6d44f3b..fe0d2c18ab 100644
--- a/src/pal/src/map/map.cpp
+++ b/src/pal/src/map/map.cpp
@@ -179,7 +179,7 @@ FileMappingCleanupRoutine(
if (pImmutableData->bPALCreatedTempFile)
{
- InternalUnlink(pThread, pImmutableData->szFileName);
+ InternalUnlink(pImmutableData->szFileName);
}
}
@@ -240,7 +240,6 @@ FileMappingInitializationRoutine(
reinterpret_cast<CFileMappingProcessLocalData *>(pvProcessLocalData);
pProcessLocalData->UnixFd = InternalOpen(
- pThread,
pImmutableData->szFileName,
MAPProtectionToFileOpenFlags(pImmutableData->flProtect)
);
@@ -506,7 +505,7 @@ CorUnix::InternalCreateFileMapping(
#if HAVE_MMAP_DEV_ZERO
- UnixFd = InternalOpen(pThread, pImmutableData->szFileName, O_RDWR);
+ UnixFd = InternalOpen(pImmutableData->szFileName, O_RDWR);
if ( -1 == UnixFd )
{
ERROR( "Unable to open the file.\n");
@@ -767,7 +766,7 @@ ExitInternalCreateFileMapping:
if (bPALCreatedTempFile)
{
- InternalUnlink(pThread, pImmutableData->szFileName);
+ InternalUnlink(pImmutableData->szFileName);
}
if (-1 != UnixFd)
@@ -784,9 +783,9 @@ ExitInternalCreateFileMapping:
if (NULL != pFileObject)
{
pFileObject->ReleaseReference(pThread);
- }
+ }
- return palError;
+ return palError;
}
/*++
diff --git a/src/pal/src/misc/dbgmsg.cpp b/src/pal/src/misc/dbgmsg.cpp
index ff38b1bef0..d7491cef15 100644
--- a/src/pal/src/misc/dbgmsg.cpp
+++ b/src/pal/src/misc/dbgmsg.cpp
@@ -550,7 +550,7 @@ int DBG_printf_gcc(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
/* Can call InternalFflush since InternalFflush does not have ENTRY/LOGEXIT
macros. If that changes, then this will need to be switched back to calling the
cruntime fflush with some other protection from suspension. */
- if (InternalFflush(pthrCurrent, output_file) != 0)
+ if (InternalFflush(output_file) != 0)
{
fprintf(stderr, "ERROR : fflush() failed errno:%d (%s)\n",
errno, strerror(errno));
@@ -661,7 +661,7 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
ENTRY/LOGEXIT macros. If that changes, then this will need
to be switched back to calling the cruntime fflush with some
other protection from suspension. */
- if (InternalFflush(pthrCurrent, output_file) != 0)
+ if (InternalFflush(output_file) != 0)
{
fprintf(stderr, "ERROR : fflush() failed errno:%d (%s)\n",
errno, strerror(errno));
diff --git a/src/pal/src/synchmgr/synchmanager.cpp b/src/pal/src/synchmgr/synchmanager.cpp
index 1a55f4f3c4..f1b8572798 100644
--- a/src/pal/src/synchmgr/synchmanager.cpp
+++ b/src/pal/src/synchmgr/synchmanager.cpp
@@ -2899,7 +2899,7 @@ namespace CorUnix
_ASSERT_MSG(fRet, "Failed to retrieve process pipe's name!\n");
- iProcessPipe = InternalOpen(pthrCurrent, strPipeFilename, O_WRONLY);
+ iProcessPipe = InternalOpen(strPipeFilename, O_WRONLY);
if (-1 == iProcessPipe)
{
ERROR("Unable to open a process pipe to wake up a remote thread "
@@ -3778,7 +3778,7 @@ namespace CorUnix
{
/* Some how no one deleted the pipe, perhaps it was left behind
from a crash?? Delete the pipe and try again. */
- if ( -1 == InternalUnlink( pthrCurrent, szPipeFilename ) )
+ if ( -1 == InternalUnlink( szPipeFilename ) )
{
ERROR( "Unable to delete the process pipe that was left behind.\n" );
fRet = false;
@@ -3802,7 +3802,7 @@ namespace CorUnix
}
}
- iPipeRd = InternalOpen(pthrCurrent, szPipeFilename, O_RDONLY | O_NONBLOCK);
+ iPipeRd = InternalOpen(szPipeFilename, O_RDONLY | O_NONBLOCK);
if (iPipeRd == -1)
{
ERROR("Unable to open the process pipe for read\n");
@@ -3810,7 +3810,7 @@ namespace CorUnix
goto CPP_exit;
}
- iPipeWr = InternalOpen(pthrCurrent, szPipeFilename, O_WRONLY | O_NONBLOCK);
+ iPipeWr = InternalOpen(szPipeFilename, O_WRONLY | O_NONBLOCK);
if (iPipeWr == -1)
{
ERROR("Unable to open the process pipe for write\n");
@@ -3858,7 +3858,7 @@ namespace CorUnix
// Failed
if (0 != szPipeFilename[0])
{
- InternalUnlink(pthrCurrent, szPipeFilename);
+ InternalUnlink(szPipeFilename);
}
if (-1 != iPipeRd)
{
@@ -3907,7 +3907,7 @@ namespace CorUnix
if(GetProcessPipeName(szPipeFilename, MAX_PATH, gPID))
{
- if (InternalUnlink(pthrCurrent, szPipeFilename) == -1)
+ if (InternalUnlink(szPipeFilename) == -1)
{
ERROR("Unable to unlink the pipe file name errno=%d (%s)\n",
errno, strerror(errno));