summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-21 16:15:19 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-21 16:15:19 +0000
commit3468e57f648ae27d4c860fa47a407bb4d669bb40 (patch)
tree6fbab4ed0f64a683891f0b025e59cd6d283c88ad /lib
parent93b34734781ce96b3abdd58be3333dbfe593d911 (diff)
Eliminate calls to system dependent function getuid by using
the newly implemented sys::Process::GetCurrentUserId function. Replace similarly for getgid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21402 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Archive/ArchiveWriter.cpp5
-rw-r--r--lib/Bytecode/Archive/ArchiveWriter.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index 8b704e8eb38..3c6a2970178 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -15,6 +15,7 @@
#include "llvm/Bytecode/Reader.h"
#include "llvm/Support/Compressor.h"
#include "llvm/System/Signals.h"
+#include "llvm/System/Process.h"
#include <fstream>
#include <iostream>
#include <iomanip>
@@ -320,9 +321,9 @@ Archive::writeSymbolTable(std::ofstream& ARFile) {
char buffer[32];
sprintf(buffer, "%-8o", 0644);
memcpy(Hdr.mode,buffer,8);
- sprintf(buffer, "%-6u", getuid());
+ sprintf(buffer, "%-6u", sys::Process::GetCurrentUserId());
memcpy(Hdr.uid,buffer,6);
- sprintf(buffer, "%-6u", getgid());
+ sprintf(buffer, "%-6u", sys::Process::GetCurrentGroupId());
memcpy(Hdr.gid,buffer,6);
sprintf(buffer,"%-12u", unsigned(secondsSinceEpoch));
memcpy(Hdr.date,buffer,12);
diff --git a/lib/Bytecode/Archive/ArchiveWriter.cpp b/lib/Bytecode/Archive/ArchiveWriter.cpp
index 8b704e8eb38..3c6a2970178 100644
--- a/lib/Bytecode/Archive/ArchiveWriter.cpp
+++ b/lib/Bytecode/Archive/ArchiveWriter.cpp
@@ -15,6 +15,7 @@
#include "llvm/Bytecode/Reader.h"
#include "llvm/Support/Compressor.h"
#include "llvm/System/Signals.h"
+#include "llvm/System/Process.h"
#include <fstream>
#include <iostream>
#include <iomanip>
@@ -320,9 +321,9 @@ Archive::writeSymbolTable(std::ofstream& ARFile) {
char buffer[32];
sprintf(buffer, "%-8o", 0644);
memcpy(Hdr.mode,buffer,8);
- sprintf(buffer, "%-6u", getuid());
+ sprintf(buffer, "%-6u", sys::Process::GetCurrentUserId());
memcpy(Hdr.uid,buffer,6);
- sprintf(buffer, "%-6u", getgid());
+ sprintf(buffer, "%-6u", sys::Process::GetCurrentGroupId());
memcpy(Hdr.gid,buffer,6);
sprintf(buffer,"%-12u", unsigned(secondsSinceEpoch));
memcpy(Hdr.date,buffer,12);