I'm implementing an FTP like protocol in Linux (homework) and I came upon the following problem: the client may be able to connect() and write() before the other side managed to do accept() (but after it did listen()). How can I prevent the write operation from working without relying on passing messages like "accept succeeded, you can write now" in a different communication channel?
Hi, we are doing a flash boot, with an NFS driver from a host
machine mapped as the root directory. How to have that file system in the
flash (flash memory ) itself in linux environment ?
Hi,
I am using linux, gcc, c.
I have a make file.
I want to debug my module.
How can I do it?
I don't want to debug a single file, I want to debug the whole module.
I'm looking for a good multi-thread-aware debugger, capable of showing performance charts of application threads on Linux, don't know if such a thing exists, perhaps as a Eclipse plugin.
The idea would be to track per thread memory allocation a CPU usage as well as being able to interrupt a thread and examine its stack trace, local vars, etc.
It does not have to be an eclipse plugin or a free tool, do any of you have heard of something similar?
Are there any working packages to change a linux user passwords using PHP?
I've tried using PECL:PAM but theres an error when it tries to change the password.
I'm implementing an FTP-like protocol in Linux kernel 2.4 (homework), and I was under the impression that if a file is open for writing any subsequent attempt to open it by another thread should fail, until I actually tried it and discovered it goes through.
How do I prevent this from happening?
PS: I'm using open() to open the file.
If I use send() on a non-blocking tcp socket in Linux will it return EAGAIN for anything other than a send buffer full condition?
I basically need to decide if I want to use the socket send buffer as the only buffer for my app or if I need my own user space buffer to feed the socket buffer.
Is there a way in python to programmatically determine the width of the console? I mean the number of characters that fits in one line without wrapping, not the pixel width of the window.
Edit
Looking for a solution that works on Linux
There's plenty of websites for it, but they're all Flash, not of much use for servers without graphics mode. Any tool I can use to test up/down bandwidth from Linux command line?
I have a client server situation in which I receive data using
read(socket, char_buf, BUF_SIZE)
and then try to write it into a log file using
write(filefd, char_buf, strlen(char_buf))
Strangely enough this fails (write returns -1), and yet the errno is set to 0, and I can print the message, AND the log file descriptor works (I write to it before and after this command).
What's going on??
(Working on Linux kernel 2.4 (homework))
I'm coming to C++ from a .Net background. Knowing how to use the Standard C++ Libraries, and all the syntax, I've never ventured further. Now I'm looking learning a bit more, such as what libraries are commonly used? I want to start getting into Threading but have no idea to start. Is there a library (similar to how .net has System.Threading) out there that will make it a bit easier? I'm specifically looking to do Linux based network programming.
How do I get the number of packages transmitted per TCP connection?
I am using Java, but i know I will have to fetch the number from the underlying OS, so this quastion applies to Linux and Windows operating systems and will have different answers for each of them, I assume.
I need this information to profile the network load of an application which seems to send too many small packages by flushing the socket streams too often.
Within a minute of connecting to my remote Linux server through SSH, my session times out and I cannot contact the server until a few seconds have passed. Meanwhile, I'm connected to other servers without interruption. This is only happening when I establish connection from an hotel wireless AP. When I connect from my phone's Internet, the problem does not occur. Does anyone know what might be causing these unusual timeouts?
I'm converting some code written for a linux system to a windows system. I'm using C++ for my windows system and wanted to know the equivalent of the function inet_aton.
I find myself doing this a lot:
script/generate migration my_new_migration
.. then select & copy the generated filename, then paste it into vi to actually write the migration.
Is there any way to do this in one step? i.e. when the script/generate migration runs, it creates the file the automatically opens that file in an editor?
(I'm working in an SSH terminal window on linux..)
I generally have ignored using macros while writing in C but I think I know fundamentals about them. While i was reading the source code of list in linux kernel, i saw something like that:
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
(You can access the remaining part of the code from here.)
I didn't understand the function of ampersands(I don't think they are the address of operands here) in LIST_HEAD_INIT and so the use of LIST_HEAD_INIT in the code. I'd appreciate if someone can enlighten me.
Is it possible to clear a file preserving its timestamp, using standard Linux commands? For example:
echo "" file-name
converts the text file to empty, this is OK for me. But I need to keep the timestamp unchanged.
Hi,
I am using C language and Linux as my programming platform.
I am learning how to create a daemon, and I want to create a log file so that I write a debug message in my daemon. My question is where should I put the log file in my system. Should I put it in the var folder?
Please advice.
Many thanks.
I'm messing around with Linux kernel 2.4 and function schedule() in sched.c uses the macro prepare_arch_schedule, which appears to be an infinite loop. What is that? And how does it finish?
I'm curious how far others have pushed Boost.Asio in terms of scalability. I am writing an application that may use close to 1000 socket objects, a handful of acceptor objects, and many thousand timer objects. I've configured it such that there's a thread pool invoking io_service::run and use strands in the appropriate places to ensure my handlers do not stomp on each other.
My platform is Red Hat Enterprise Linux with Boost 1.39, though I'm not opposed to upgrading to a more recent version of boost.
I noticed that in Linux kernel 2.4 setscheduler doesn't force need_resched. Why is that? is it just some convention, or does that happens somewhere else?
I have a series of python scripts with execute permissions in Linux. They are stored in SVN.
If I then run svn up to update them, the overwritten files are back to 644 - ie no execute permissions for anyone.
Yes I could just script it to chmod +x * afterwards, but surely there's a way to store permissions in SVN or to maintain them when you update?
Any suggestions appreciated.
This is a totally newbie question. I'm running Eclipse on Ubuntu. I created a test project that I want to compile to an executable (whataver the linux equivalent is of a Windows .exe file). Here's the contents of my program:
public class MyTest {
public static void main(String[] args) {
System.out.println("You passed in: " + args[0]);
}
}
I want to know how to compile it and then how to execute it from the command line.
Thanks!