summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibC/serenity.cpp5
-rw-r--r--Libraries/LibC/serenity.h2
-rw-r--r--Libraries/LibC/sys/ptrace.cpp4
-rw-r--r--Libraries/LibC/sys/ptrace.h5
-rw-r--r--Libraries/LibCore/ProcessStatisticsReader.h2
-rw-r--r--Libraries/LibThread/Lock.h6
6 files changed, 13 insertions, 11 deletions
diff --git a/Libraries/LibC/serenity.cpp b/Libraries/LibC/serenity.cpp
index 5837aee15f..8c357d0828 100644
--- a/Libraries/LibC/serenity.cpp
+++ b/Libraries/LibC/serenity.cpp
@@ -60,13 +60,13 @@ int profiling_disable(pid_t pid)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int set_thread_boost(int tid, int amount)
+int set_thread_boost(pid_t tid, int amount)
{
int rc = syscall(SC_set_thread_boost, tid, amount);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-int set_process_boost(int tid, int amount)
+int set_process_boost(pid_t tid, int amount)
{
int rc = syscall(SC_set_process_boost, tid, amount);
__RETURN_WITH_ERRNO(rc, rc, -1);
@@ -136,5 +136,4 @@ int get_stack_bounds(uintptr_t* user_stack_base, size_t* user_stack_size)
int rc = syscall(SC_get_stack_bounds, user_stack_base, user_stack_size);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
-
}
diff --git a/Libraries/LibC/serenity.h b/Libraries/LibC/serenity.h
index 55423f13c2..396cd34f8d 100644
--- a/Libraries/LibC/serenity.h
+++ b/Libraries/LibC/serenity.h
@@ -52,7 +52,7 @@ int profiling_disable(pid_t);
#define THREAD_PRIORITY_HIGH 50
#define THREAD_PRIORITY_MAX 99
-int set_thread_boost(int tid, int amount);
+int set_thread_boost(pid_t tid, int amount);
int set_process_boost(pid_t, int amount);
#define FUTEX_WAIT 1
diff --git a/Libraries/LibC/sys/ptrace.cpp b/Libraries/LibC/sys/ptrace.cpp
index fd97a0ffca..a83d8ec79b 100644
--- a/Libraries/LibC/sys/ptrace.cpp
+++ b/Libraries/LibC/sys/ptrace.cpp
@@ -31,7 +31,7 @@
extern "C" {
-int ptrace(int request, pid_t pid, void* addr, int data)
+int ptrace(int request, pid_t tid, void* addr, int data)
{
// PT_PEEK needs special handling since the syscall wrapper
@@ -49,7 +49,7 @@ int ptrace(int request, pid_t pid, void* addr, int data)
Syscall::SC_ptrace_params params {
request,
- pid,
+ tid,
reinterpret_cast<u8*>(addr),
data
};
diff --git a/Libraries/LibC/sys/ptrace.h b/Libraries/LibC/sys/ptrace.h
index b1008f62ca..edb45aeec9 100644
--- a/Libraries/LibC/sys/ptrace.h
+++ b/Libraries/LibC/sys/ptrace.h
@@ -40,6 +40,9 @@ __BEGIN_DECLS
#define PT_POKE 8
#define PT_SETREGS 9
-int ptrace(int request, pid_t pid, void* addr, int data);
+// FIXME: PID/TID ISSUE
+// Affects the entirety of LibDebug and Userland/strace.cpp.
+// See also Kernel/Ptrace.cpp
+int ptrace(int request, pid_t tid, void* addr, int data);
__END_DECLS
diff --git a/Libraries/LibCore/ProcessStatisticsReader.h b/Libraries/LibCore/ProcessStatisticsReader.h
index c260735ffa..6620365d08 100644
--- a/Libraries/LibCore/ProcessStatisticsReader.h
+++ b/Libraries/LibCore/ProcessStatisticsReader.h
@@ -33,7 +33,7 @@
namespace Core {
struct ThreadStatistics {
- int tid;
+ pid_t tid;
unsigned times_scheduled;
unsigned ticks;
unsigned syscall_count;
diff --git a/Libraries/LibThread/Lock.h b/Libraries/LibThread/Lock.h
index 4fe0bb88f5..b6a82c42a2 100644
--- a/Libraries/LibThread/Lock.h
+++ b/Libraries/LibThread/Lock.h
@@ -44,7 +44,7 @@ public:
void unlock();
private:
- Atomic<int> m_holder { 0 };
+ Atomic<pid_t> m_holder { 0 };
u32 m_level { 0 };
};
@@ -65,14 +65,14 @@ private:
ALWAYS_INLINE void Lock::lock()
{
- int tid = gettid();
+ pid_t tid = gettid();
if (m_holder == tid) {
++m_level;
return;
}
for (;;) {
int expected = 0;
- if (m_holder.compare_exchange_strong(expected, tid, AK::memory_order_acq_rel)) {
+ if (m_holder.compare_exchange_strong(expected, tid, AK::memory_order_acq_rel)) {
m_level = 1;
return;
}