freebsd

error : BOOST DISABLE THREADS

China☆狼群 提交于 2019-12-17 15:53:33
问题 i have some problem with my boost library. i m using freebsd and installed my boost using ports. Boost version is : 1.45 and i use g++47 as compiler. Also i have never defined BOOST DISABLE THREADS at there : /usr/local/include/boost/config/user.hpp .Also exactly my error is : /usr/local/include/boost/config/requires_threads.hpp:29:4: error: #error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS" explicitly but where ?? And my compile command; g++47

InetAddress.getLocalHost() throws UnknownHostException

孤者浪人 提交于 2019-12-17 02:11:07
问题 I am testing our server-application (written Java) on different operating systems and thought that OpenSolaris (2008.11) would be the least troublesome due to the nice Java integration. Turns out I was wrong, as I end up with a UnknownHostException try { computerName = InetAddress.getLocalHost().getHostName(); if (computerName.indexOf(".") > -1) computerName = computerName.substring(0, computerName.indexOf(".")).toUpperCase(); } catch (UnknownHostException e) { e.printStackTrace(); } The

How to pretend to be a tty when trying to freebsd-update from a shell script?

£可爱£侵袭症+ 提交于 2019-12-14 03:12:23
问题 We usually use a custom script to setup new FreeBSD machines after system installation, which installs tools from ports tree and sets up system environment. we also need to automate update newly installed FreeBSD-8.2 machines to FreeBSD-8.2p3 by freebsd-update. As I know, freebsd-update doesn't allow me to execute it from a shell script without a "cron" option. So I try to preload a custom program to cheat freebsd-update: ${CAT} > /tmp/isatty.c <<EOF int isatty(const int fd) { return 1; } EOF

pthreads lock recovery

感情迁移 提交于 2019-12-14 03:07:36
问题 I am working on a multi-threaded network server application. At the moment, I am having issues with lock recovery. If a thread dies unexpectedly while it is holding a lock, say a mutex, rwlock, spinlock, etc..., is it possible to recover the lock from a different thread without having to go into the lock struct itself and manually disassociate the owner from the lock. I would like to not have to go to this extreme to clear it as this will make the code non-portable. I have attempted to force

freebsd add custom syscall by compiling the kernel?

蓝咒 提交于 2019-12-13 18:43:13
问题 for school work I have to add custom helloworld syscall to freebsd. I used following link as my guide: http://members.tripod.com/s_mathur/bsdhowto.html OK! In step two I got problem: root has not permission to run it so I used: "make sysent" instead. seems ok. Step 4 says: 4. Modify the Makefile to include sys_hello.c,etc and recompile the kernel.!!! Which makefile? and how to compile it and how call syscall hello? tnx in advance 回答1: If sys_hello.c contains your syscall implementation - and

Failing to link c code to lapack: undefined reference

天涯浪子 提交于 2019-12-13 06:56:36
问题 I am trying to use lapack functions from C. Here is some test code, copied from this question #include <stdlib.h> #include <stdio.h> #include <time.h> #include "clapack.h" #include "cblas.h" void invertMatrix(float *a, unsigned int height){ int info, ipiv[height]; info = clapack_sgetrf(CblasColMajor, height, height, a, height, ipiv); info = clapack_sgetri(CblasColMajor, height, a, height, ipiv); } void displayMatrix(float *a, unsigned int height, unsigned int width) { int i, j; for(i = 0; i <

Convert std::filebuf(FILE*) to use libc++

独自空忆成欢 提交于 2019-12-13 05:12:25
问题 I have some existing code that I am trying to compile using clang 3.3 and libc++ from llvm.org. A simple step to retrieve the result of another command. It appears that std::filebuf doesn't offer a FILE* constructor any more and all the ideas that I have tried to replace the code have all failed to open the command, that is fb.is_open() always returns false. From what I can find I would have to use something like fb.open(cppcommand.c_str(), std::ios::in); instead of popen. The essential parts

Make starts in wrong directory under FreeBSD

让人想犯罪 __ 提交于 2019-12-13 03:46:51
问题 I have a very simple Makefile that just shells out to another Makefile: all: cd src && make all My directory structure (the Makefile is in the top-level directory): [I] mqudsi@php ~/bbcp> tree -d . ├── bin │ └── FreeBSD ├── obj │ └── FreeBSD ├── src └── utils This works just fine under Linux, but under FreeBSD, it gives an error about src not being found. To debug, I updated the Makefile command to pwd; cd src && make all and I discovered that somehow when I run make in the top-level

Broken Pipe error

你说的曾经没有我的故事 提交于 2019-12-13 02:43:56
问题 I am using write() on a opened data socket in FTP implementation to send the file out. But after writing some data it is hanging for some time; and after that it is returning with Broken pipe error. any help in this will greatly appreciated. My process reads packets from one buff and writes in to the socket. I noticed this problem with increased bandwidth. If i increased number of packets to be processed then the problem is coming. i am using FreeBSD. I am using two threads one reads packets

Linux FreeBSD shared object problem

谁说胖子不能爱 提交于 2019-12-12 14:14:34
问题 I am trying to build an application for freebsd which links to a shared object "share.so" built on linux. I also have freebsd linux compatible libraries under /usr/compat/linux/lib. I am able to compile my application. But while linking to "share.so" I am getting bunch of errors as share.so(built on linux) needs to access libraries under "/usr/compat/linux/lib". Is there a way to tell share.so to look into compat linux directory instead of /usr/lib/ /usr/bin/ld: warning: libstdc++.so.6,