Questions tagged [librt]

17 questions
15
votes
2 answers

What is librt.so? How can I use it directly?

I find some libraries are linked to librt.so, while others are not. I am wondering in what circumstances it is linked. I have never used this library directly. Is there any demo showing the direct usage of it? Is there a header file related to it?
jinge
  • 785
  • 1
  • 7
  • 20
5
votes
1 answer

What are the differences between librt and libeio for asynchronous I/O, and why would I choose one over the other?

I really want to put more in the body to explain the question… but the title really covers it all. As far as I can suss, librt is more “official” (it’s a standard part of libc?), but I also remember seeing that Node.js uses libeio. Which should I…
ELLIOTTCABLE
  • 17,185
  • 12
  • 62
  • 78
5
votes
1 answer

Why does linking to librt swap performance between g++ and clang?

I just found this answer from @tony-d with a bench code to test virtual function call overhead. I checked is benchmark using g++: $ g++ -O2 -o vdt vdt.cpp -lrt $ ./vdt virtual dispatch: 150000000 0.128562 switched: 150000000 0.0803207 overheads:…
Holt
  • 36,600
  • 7
  • 92
  • 139
5
votes
2 answers

undefined reference to `shm_open' using CMake

I am using CMake under Ubuntu 14.04 to configure my project. I need to use a 3rd party library (say stuff.so). In the CMakeLists.txt, I use TARGET_LINK_LIBRARIES to link the stuff library. However, I got an error: DIR_TO_LIB/stuff.so:-1: error:…
linzhang.robot
  • 359
  • 1
  • 8
  • 23
4
votes
0 answers

Posix timer functions on windows (timer_t, timer_create, timer_start)

Is it possible to compile code, using mingw64, that uses librt functionality? The functions needed a listed below. I am struggling to find any information to that question. int timer_create(clockid_t clockId, struct sigevent *evp, timer_t…
Niecore
  • 312
  • 3
  • 10
4
votes
1 answer

How do I get Python to see librt?

I just installed python-dev with: $ sudo apt-get install python-dev so that I can start using P4Python. But when I try to import P4, I get: Traceback (most recent call last): File "/opt/pycharm-2.5/helpers/pycharm/utrunner.py", line 113, in…
Noel Yap
  • 18,822
  • 21
  • 92
  • 144
3
votes
1 answer

Ndk toolchain complaining about missing lrt option

Getting below error on NDK-build /ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux- x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lrt I updated Android.mk for…
Ravikant Tiwari
  • 371
  • 3
  • 11
1
vote
1 answer

compiling librt(3LIB) from source

Folks, I am writing a program on ubuntu which uses posix shared memory and semophores. I was trying to link directly to the onboard /usr/lib/x86_64-linux-gnu/librt.so however the shared object library isn't ABI compatible with my program. The…
David McCabe
  • 107
  • 1
  • 8
1
vote
1 answer

How to build glibc with modified malloc which uses shm_open()?

I am modifying the malloc.c and hooks.c file in glibc library and my modification uses shm_open(). Now to build glibc, the Man page of shm_open() says that I need to link with -lrt. The problem that I am facing is, as far as I know, librt is…
dodobhoot
  • 493
  • 6
  • 15
1
vote
2 answers

Compile only parts of glibc

I want to compile only one of the many libs that come with glibc. Namely all I need is the static version of the librt library (librt.a). Is there a way to tell configure/make to do just that? Right now, I have a process set up where I set specific…
Perlator
  • 241
  • 1
  • 2
  • 11
0
votes
0 answers

shm_open gives segmentation fault when it compiled with -static flag

I am trying to build a shared memory application where I can share data between unrelated processes. In my example, POSIX shm_open call works fine if I use the Dynamic linking while building as below gcc main.c -o example -lpthread -lrt But when I…
F.K
  • 1
  • 1
0
votes
2 answers

Why am I denied permission trying to shm_open?

Consider the following C program: #include #include #include #include #include #include int main() { const char* name = "/memmap_ipc_shm"; int shmFd = shm_open(name, O_RDWR…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
1 answer

Makefile g++ lrt problem. Cannot find lrt

Here is my makefile. # The intuitive "all" target will be our default. .DEFAULT_GOAL := all # Component dir's to search and invoke make. # (Try preserving the order of directories) COM := src_dir1 src_dir2 src_dir3 PROJ_DIR = $(shell pwd) EXEC :=…
Ace
  • 1,501
  • 4
  • 30
  • 49
0
votes
1 answer

LD_PRELOAD malloc to shm_open

I'm trying to intercept malloc call using LD_PRELOAD. I want to move all memory allocation to shared memory by changing malloc to shm_open followed by mmap. How can I do it? LD_PRELOAD of malloc works fine. I can intercept every malloc call.…
0
votes
1 answer

Building QT Embedded with librt

I'm building QT embedded 4.7 for the OMAP3 platform. at the link stage, it fails because clock_gettime has no symbol. In my own applications in the past, i've solved this by linking in librt. Have i configured QT embedded wrong? how do i get librt…
Woodrow Douglass
  • 2,605
  • 3
  • 25
  • 41
1
2