Why is No manual entry for pthread_mutex_lockerror prompted? - c

I want to check the use of the pthread_mutex_lock function, so I execute the command man pthread_mutex_lock, the result appears No manual entry for pthread_mutex_lock.
I checked the information on the Internet and said that there was a No manual entry for pthread_mutex_lock prompt, need to install manpages-posix-dev.
So I'm ready to install manpages-posix-dev(I execute the command: apt-get install manpages-posix-dev), but E: Unable to locate package manpages-posix-dev prompts me again. Why?I'm using the debian 10 system.
gyz#debian:~$ man pthread_mutex_lock
No manual entry for pthread_mutex_lock
gyz#debian:~$ sudo apt-get install manpages-posix-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package manpages-posix-dev
gyz#debian:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
gyz#debian:~$ getconf LONG_BIT
64
gyz#debian:~$ cat /proc/version
Linux version 4.19.0-9-amd64 (debian-kernel#lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1
SMP Debian 4.19.118-2+deb10u1 (2020-06-07)

(Even though the question is tagged Debian it appears in generic search results)
The answer for Fedora is that Fedora has removed posix manpages entirely; you need to download/install 'manually' (there's a make installer included in the archive) from https://www.kernel.org/pub/linux/docs/man-pages/man-pages-posix/
(Thanks to redditors)

Related

Installing clang 3.4 and LLVM 3.4 on ubuntu

I want to install clang-3.4 , opt-3.4 and llc-3.4 on my ubuntu 16.04.
I want specific version 3.4 only.
opt-3.4: It is LLVM optimizer.
llc-3.4: It is LLVM static compiler.
Running the installation command gives me error:
$ sudo apt-get install clang-3.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package clang-3.4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
clang-5.0:i386 clang-3.9:i386 clang-3.8:i386 clang:i386 clang-5.0 clang-3.9 clang-3.8 clang clang-4.0:i386 clang-4.0 clang-3.7:i386
clang-3.6:i386 clang-3.5:i386 clang-3.7 clang-3.6 clang-3.5
E: Package 'clang-3.4' has no installation candidate
How can I install the 3.4 version of packages?
EDIT:
Answers on how to port the project to a recent version of clang is also welcome.

How can I retrieve the package-relevant architecture of a Debian Linux system?

I currently try to build a Debian package for the armhf (ARMv7) architecture, but I want the build script to recognize the architecture itself. The problem is, that I can not find the architecture, that APT uses to retrieve the package from a repository.
In my case, APT uses armhf, when it retrieves packages.
When I run uname -m, I get armv7 as a result. A grep -rn armhf /etc does not show any appearance of armhf, relevant for APT to choose from.
So, where can I get (Debian 9 (Stretch) or Armbian next) a reliable source for that information from the system that is independent of the architecture (my script should run also on i686, amd64, armel & arm64)?
The answer is
dpkg --print-architecture
This gives you the architecture Debian is selecting for packages. I'm not sure what happens on multi-architecture systems (i686 and amd64), but this can be separated quite easily.

Kernel version for target and for module

I'm trying to build a simple kernel module and run it on the Raspberry Pi. I have downloaded kernel sources from official raspberry site, but they have slightly different kernel version then my raspbian on board.
Is it necessary to have fully identical version of kernel on source and target machine to run kernel module? I have this on my Raspberry Pi
$ uname -a
Linux raspberrypi 4.4.11+ #888 Mon May 23 20:02:58 BST 2016 armv6l GNU/Linux
And this about my module
$ modinfo ./threads.ko
filename: /lib/modules/4.4.11+/kernel/mymodules/./threads.ko
version: 0.0.1
description: Kernel threads example
author: xxxxxx
license: GPL
srcversion: C906582EC824D2D8DA76BFB
depends:
vermagic: 4.4.13+ mod_unload modversions ARMv6
As you see: "4.4.11+" vs "4.4.13+"...
Why am I asking? I have a error when insert module:
$ sudo insmod ./threads.ko
insmod: ERROR: could not insert module ./threads.ko: Invalid module format
And do not understand, it is valuable difference in last number of version of the kernel or there is another problem.
Is it necessary to have fully identical version of kernel on source and target machine to run kernel module?
Yes.

How do I install libcap on Ubuntu 12.04?

I am trying to get libcap to work on my machine (running Ubuntu 12.04) but I am currently unable to get this done:
Here is how it all began:
In Eclipse I got the warning that it could not resolve pcap.h.
It said Unresolved inclusion <pcap.h>
I installed libcap like this: sudo apt-get install libcap-dev
I restarted my machine.
And now I am still getting the warning that it cannot resolve pcap.h.
What am I doing wrong? Any ideas?
Try installing linux-headers, but you will need to know your kernel version:
Ex.:
tiago#dell:~$ sudo uname -a
Linux dell 3.11.0-20-generic #35~precise1-Ubuntu SMP Fri May 2 21:32:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
tiago#dell:~$ sudo apt-get install linux-headers-3.11.0-20
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-3.11.0-20 is already the newest version.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

/lib/libc.so.6: version `GLIBC_2.17' not found

I am trying to compile a program to put on a BeagleBone black, but im getting this error
when running the program on my board:
/lib/libc.so.6: version `GLIBC_2.17' not found
I made sure that i cross compiled for ARM (arm-linux-gnueabi-gcc).
On my desktop, I have EGLIBC 2.17-9.
What did i do wrong?
Had face the same problem.
Solved it by the following steps.
Downloaded "libc6_2.17-0ubuntu5.1_i386.deb"
sudo dpkg -i ipts libc6_2.17-0ubuntu5.1_i386.deb
sudo dpkg -i ipts libc6_2.17-0ubuntu5.1_i386.deb
Download 64 bit package from this site https://launchpad.net/ubuntu/raring/amd64/libc6/2.17-0ubuntu4
Install libc6 2.17 by the command ,
sudo dpkg -i libc6_2.17-0ubuntu4_amd64.deb
Cheers !
You don't have glibc 2.17 installed on your target board. You need to ensure that you have the SAME version of glibc (for ARM) installed on both the target board and on your build machine (your desktop). You can do this by either installing 2.17 on the target board or by figuring out what version you have installed there and installing that same version on your build machine (and linking with it).
This shell script worked for me: https://groups.google.com/forum/#!category-topic/beagleboard/oPq-Xt0TVdY
see the response from "A P" which is a script that installs a later version on the beaglebone black:
I am running a beaglebone black rev C with debian wheezy.
#!/bin/sh
echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get -t sid install libc6 libc6-dev libc6-dbg
echo "Please remember to hash out sid main from your sources list. /etc/apt/sources.list"

Resources