portability

A bind with a port of zero will bind you to a free port. Is this portable? [closed]

此生再无相见时 提交于 2019-12-22 07:37:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 months ago . I want my program to bind to a free port. Google told me that a bind with port=0 will do that, but I haven't found if this is guaranteed to work on any system (Windows/Linux in particular). Can someone link a doc that say that? 回答1: It's universal as far as I know, but I can't find any text in the standards

Alternatives to fread and fwrite for use with structured data

﹥>﹥吖頭↗ 提交于 2019-12-22 06:25:11
问题 The book Beginning Linux Programming (3rd ed) says "Note that fread and fwrite are not recommended for use with structured data. Part of the problem is that files written with fwrite are potentially nonportable between different machines." What does that mean exactly? What calls should I use if I want to write a portable structured data reader or writer? Direct system calls? 回答1: The book is wisely cautioning against reading an block of bytes from a file directly into a data structure. The

Does “volatile” guarantee anything at all in portable C code for multi-core systems?

拜拜、爱过 提交于 2019-12-22 03:15:33
问题 After looking at a bunch of other questions and their answers, I get the impression that there is no widespread agreement on what the "volatile" keyword in C means exactly. Even the standard itself does not seem to be clear enough for everyone to agree on what it means. Among other problems: It seems to provide different guarantees depending on your hardware and depending on your compiler. It affects compiler optimizations but not hardware optimizations, so on an advanced processor that does

Carrying and Working on an Entire Development Box from a USB Stick. Feasible?

好久不见. 提交于 2019-12-21 23:17:17
问题 Lately I have been thinking about investing in a worthy USB pen drive (something along the lines of this), and install Operating Systems on Virtual Machines and start developing on them. What I have in mind is that I want to be able to carry my development boxes, being a Windows Distribution for .Net development and a Linux Distribution for stuff like RoR, Perl and whatnot, so that I would be able to carry them around where need be...be it work, school, different computers at home etc... I am

Are there actual systems where difftime accounts for leap seconds?

守給你的承諾、 提交于 2019-12-21 20:14:55
问题 The C standard (ISO/IEC 9899) states: 7.2x.2.2 The difftime function Synopsis #include <time.h> double difftime(time_t time1, time_t time0); Description The difftime function computes the difference between two calendar times: time1 - time0 . Returns The difftime function returns the difference expressed in seconds as a double . This leaves it ambiguous (I guess, intentionally) if the result accounts for leap seconds or not. The difference (26 seconds when comparing from 1970 to July 2015)

Are docker images portable across different linux flavours?

落爺英雄遲暮 提交于 2019-12-21 19:22:19
问题 Are docker images portable across different linux flavours? Let's say, if I have OEL based docker image with database installed in it, can I run this in boot2docker on a Mac? 回答1: Yes, you can archive an image (docker save/docker load), copy it on your mac unless your image and run a container in a boot2docker Tiny Core VM. The only case where an image might not be portable is if its OS filesystem depends on certain patch level of the kernel. In that case, a container from that image would

Portably handle exceptional errors in C++

此生再无相见时 提交于 2019-12-21 17:18:20
问题 I'm working on porting a Visual C++ application to GCC (should build on MingW and Linux). The existing code uses __try { ... } __except(1) { ... } blocks in a few places so that almost nothing (short of maybe out of memory type errors?) would make the program exit without doing some minimal logging. What are the options for doing something similar with GCC? Edit: Thanks for the pointer to /EH options in Visual Studio, what I need now is some examples on how to handle signals on Linux. I've

Compiling with individual Boost libraries, Without installing Boost

孤人 提交于 2019-12-21 17:05:11
问题 I'm implementing on some C++ code that I would like to make as portable as possible. I would like to avoid dependencies on libraries that require root access to install. Further, I'd prefer to avoid keeping copies of large libraries in my repository, and I would also prefer not to do user-level installations of libraries (simply because I'd have to manually install them on multiple computers.) I would like to use the normal_distribution functionality from Boost in my project. I understand

Creating portable (non-installing) windows applications in C#

为君一笑 提交于 2019-12-21 13:04:41
问题 I have a .net 3.5 application and i'd like to make it portable. It's simple and runs perfectly, i've sent the .EXE + .DLL's to some friends and it works as intended when running the exe with the .DLL's and the .ICO (that i have used in it) along in the same folder. What i want is simple: creating a single EXE file that cares the dll's, image and whatever-i-want along with it without being a setup, and requiring no installation. (a.k.a portable) I may consider migrating it to .net 2.0 if

Creating portable (non-installing) windows applications in C#

被刻印的时光 ゝ 提交于 2019-12-21 13:04:05
问题 I have a .net 3.5 application and i'd like to make it portable. It's simple and runs perfectly, i've sent the .EXE + .DLL's to some friends and it works as intended when running the exe with the .DLL's and the .ICO (that i have used in it) along in the same folder. What i want is simple: creating a single EXE file that cares the dll's, image and whatever-i-want along with it without being a setup, and requiring no installation. (a.k.a portable) I may consider migrating it to .net 2.0 if