[TOC]
vim /etc 写入时 出现 E121:无法打开并写入文件
解决方案:
- 保存的时候用:w !sudo tee %
- 输入密码,即可
安装中文输入法
安装步骤
1.更新源文件,使用的是阿里云源
打开sources.list文件
1 | leafpad /etc/apt/sources.list |
复制源地址到文本中
1 | deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib |
更新安装源
1 | apt-get update |
2.下载IBus完后重启系统
1 | apt-get install ibus |
3.IBus配置
鼠标右键选择设置(setting)>区域和语言(Region&Language),在输入源中添加汉语(PinYin),可通过搜索PinYin找到。
Linux 编程
gcc 多线程编译失败

今天写一个线程的程序,已经在c文件中包含了线程的头文件<pthread.h>,可是编译的时候却报错“对pthread_create未定义的引用“,原来时因为 pthread库不是Linux系统默认的库,连接时需要使用库libpthread.a,所以在使用pthread_create创建线程时,在编译中要加-lpthread参数:gcc createThread.c -lpthread -o createThread. 加上这个以后编译成功!


1 | {//线程创建相关函数 |
1 |
|
互斥锁

信号量



