"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Utilities/cmlibuv/src/unix/openbsd.c" between
cmake-3.13.4.tar.gz and cmake-3.14.0-rc1.tar.gz

About: CMake is a cross-platform build system designed to build, test and package software. Release candidate.

openbsd.c  (cmake-3.13.4):openbsd.c  (cmake-3.14.0-rc1)
skipping to change at line 38 skipping to change at line 38
#include <sys/time.h> #include <sys/time.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <paths.h> #include <paths.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
static uv_mutex_t process_title_mutex;
static uv_once_t process_title_mutex_once = UV_ONCE_INIT;
static char *process_title;
static void init_process_title_mutex_once(void) {
uv_mutex_init(&process_title_mutex);
}
int uv__platform_loop_init(uv_loop_t* loop) { int uv__platform_loop_init(uv_loop_t* loop) {
return uv__kqueue_init(loop); return uv__kqueue_init(loop);
} }
void uv__platform_loop_delete(uv_loop_t* loop) { void uv__platform_loop_delete(uv_loop_t* loop) {
} }
void uv_loadavg(double avg[3]) { void uv_loadavg(double avg[3]) {
struct loadavg info; struct loadavg info;
size_t size = sizeof(info); size_t size = sizeof(info);
skipping to change at line 140 skipping to change at line 132
uint64_t info; uint64_t info;
int which[] = {CTL_HW, HW_PHYSMEM64}; int which[] = {CTL_HW, HW_PHYSMEM64};
size_t size = sizeof(info); size_t size = sizeof(info);
if (sysctl(which, 2, &info, &size, NULL, 0)) if (sysctl(which, 2, &info, &size, NULL, 0))
return UV__ERR(errno); return UV__ERR(errno);
return (uint64_t) info; return (uint64_t) info;
} }
char** uv_setup_args(int argc, char** argv) {
process_title = argc ? uv__strdup(argv[0]) : NULL;
return argv;
}
int uv_set_process_title(const char* title) {
char* new_title;
new_title = uv__strdup(title);
uv_once(&process_title_mutex_once, init_process_title_mutex_once);
uv_mutex_lock(&process_title_mutex);
if (process_title == NULL) {
uv_mutex_unlock(&process_title_mutex);
return UV_ENOMEM;
}
uv__free(process_title);
process_title = new_title;
setproctitle("%s", title);
uv_mutex_unlock(&process_title_mutex);
return 0;
}
int uv_get_process_title(char* buffer, size_t size) {
size_t len;
if (buffer == NULL || size == 0)
return UV_EINVAL;
uv_once(&process_title_mutex_once, init_process_title_mutex_once);
uv_mutex_lock(&process_title_mutex);
if (process_title) {
len = strlen(process_title) + 1;
if (size < len) {
uv_mutex_unlock(&process_title_mutex);
return UV_ENOBUFS;
}
memcpy(buffer, process_title, len);
} else {
len = 0;
}
uv_mutex_unlock(&process_title_mutex);
buffer[len] = '\0';
return 0;
}
int uv_resident_set_memory(size_t* rss) { int uv_resident_set_memory(size_t* rss) {
struct kinfo_proc kinfo; struct kinfo_proc kinfo;
size_t page_size = getpagesize(); size_t page_size = getpagesize();
size_t size = sizeof(struct kinfo_proc); size_t size = sizeof(struct kinfo_proc);
int mib[6]; int mib[6];
mib[0] = CTL_KERN; mib[0] = CTL_KERN;
mib[1] = KERN_PROC; mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID; mib[2] = KERN_PROC_PID;
mib[3] = getpid(); mib[3] = getpid();
 End of changes. 2 change blocks. 
64 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)