<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>LINUX programming Forum RSS Feed (Replies Included)</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the 'LINUX programming' forum at Programmer's Heaven, including replies.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Mon, 17 Jun 2013 21:54:27 -0700</pubDate>
    <lastBuildDate>Mon, 17 Jun 2013 21:54:27 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>NS-2 simulator question!!</title>
      <link>http://www.programmersheaven.com/mb/Linux/431309/431309/ns-2-simulator-question/</link>
      <description>hi all,&lt;br /&gt;
I just want to ask if any1 can help me in my project.&lt;br /&gt;
I'm trying to build a framework for cognitive radio using NS-2 simulator under linux fedora, so if any1 can help me please notify me, and I'll appreciate that.&lt;br /&gt;
&lt;br /&gt;
thanks all,&lt;br /&gt;
Doulat&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431309/431309/ns-2-simulator-question/</guid>
      <pubDate>Sat, 16 Feb 2013 15:06:49 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>linux help</title>
      <link>http://www.programmersheaven.com/mb/Linux/431246/431246/linux-help/</link>
      <description>Hey, I'm kinda new here and I'm here to ask you for a favor. So I've got a homework on linux programming and I'll need to explain this whole script to my lecturer in tomorrow. Can any of you please explain what does each segment of this script does? Thanks in advance.&lt;br /&gt;
&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
echo '1. New entry (Name, Surname, phone number, e-mail):'&lt;br /&gt;
echo '2. Entry search'&lt;br /&gt;
echo '3. List all entries'&lt;br /&gt;
echo '4. Delete an entry'&lt;br /&gt;
echo '5. Edit an entry'&lt;br /&gt;
echo '6. Quit'&lt;br /&gt;
&lt;br /&gt;
choice=0&lt;br /&gt;
while [ $choice -ne 6 ]&lt;br /&gt;
do&lt;br /&gt;
&lt;br /&gt;
read choice&lt;br /&gt;
&lt;br /&gt;
case $choice in&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
	echo 'Ener Name, surname, phone number and e-mail, separated by spaces:'&lt;br /&gt;
	read id&lt;br /&gt;
	echo $id &amp;gt;&amp;gt; info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
	echo 'Enter id data to search for:'&lt;br /&gt;
	read search&lt;br /&gt;
	grep -n $search info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
	echo 'Full entry-list:'&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
	echo 'Specify an entry # for removal:'&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	read del&lt;br /&gt;
	sed $del'd' info.txt&amp;gt;temp&lt;br /&gt;
	mv temp info.txt&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
5)&lt;br /&gt;
	echo 'Specify an entry # for editing:'&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	read edit&lt;br /&gt;
	echo 'Enter new data:'&lt;br /&gt;
	read id&lt;br /&gt;
	sed -i "${edit} s/.*/${id}/" info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
6)&lt;br /&gt;
	echo 'bye'&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
*)&lt;br /&gt;
	echo 'Wrong selection'&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
done&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431246/431246/linux-help/</guid>
      <pubDate>Sun, 10 Feb 2013 09:25:42 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>linux help</title>
      <link>http://www.programmersheaven.com/mb/Linux/431245/431245/linux-help/</link>
      <description>Hey, I'm kinda new here and I'm here to ask you for a favor. So I've got a homework on linux programming and I'll need to explain this whole script to my lecturer in tomorrow. Can any of you please explain what does each segment of this script does? Thanks in advance.&lt;br /&gt;
&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
echo '1. New entry (Name, Surname, phone number, e-mail):'&lt;br /&gt;
echo '2. Entry search'&lt;br /&gt;
echo '3. List all entries'&lt;br /&gt;
echo '4. Delete an entry'&lt;br /&gt;
echo '5. Edit an entry'&lt;br /&gt;
echo '6. Quit'&lt;br /&gt;
&lt;br /&gt;
choice=0&lt;br /&gt;
while [ $choice -ne 6 ]&lt;br /&gt;
do&lt;br /&gt;
&lt;br /&gt;
read choice&lt;br /&gt;
&lt;br /&gt;
case $choice in&lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
	echo 'Ener Name, surname, phone number and e-mail, separated by spaces:'&lt;br /&gt;
	read id&lt;br /&gt;
	echo $id &amp;gt;&amp;gt; info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
	echo 'Enter id data to search for:'&lt;br /&gt;
	read search&lt;br /&gt;
	grep -n $search info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
	echo 'Full entry-list:'&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
4)&lt;br /&gt;
	echo 'Specify an entry # for removal:'&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	read del&lt;br /&gt;
	sed $del'd' info.txt&amp;gt;temp&lt;br /&gt;
	mv temp info.txt&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
5)&lt;br /&gt;
	echo 'Specify an entry # for editing:'&lt;br /&gt;
	cat -n info.txt&lt;br /&gt;
	read edit&lt;br /&gt;
	echo 'Enter new data:'&lt;br /&gt;
	read id&lt;br /&gt;
	sed -i "${edit} s/.*/${id}/" info.txt&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
6)&lt;br /&gt;
	echo 'bye'&lt;br /&gt;
	;;&lt;br /&gt;
&lt;br /&gt;
*)&lt;br /&gt;
	echo 'Wrong selection'&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
done&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431245/431245/linux-help/</guid>
      <pubDate>Sun, 10 Feb 2013 09:22:51 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Re: using open(), etc. to move data on a disk with mounted partitions</title>
      <link>http://www.programmersheaven.com/mb/Linux/431088/431090/re-using-open-etc-to-move-data-on-a-disk-with-mounted-partitions/#431090</link>
      <description>Sorry about the multi-post, the forum was giving me errors on posting and I thought the posts failed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431088/431090/re-using-open-etc-to-move-data-on-a-disk-with-mounted-partitions/#431090</guid>
      <pubDate>Sun, 27 Jan 2013 13:21:37 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>using system calls to move data on a disk with mounted partitions</title>
      <link>http://www.programmersheaven.com/mb/Linux/431089/431089/using-system-calls-to-move-data-on-a-disk-with-mounted-partitions/</link>
      <description>I need to be able to move data around a disk that has mounted&lt;br /&gt;
partitions on Linux. I am not touching data inside the mounted&lt;br /&gt;
partitions or the MBR, only the free space around it or unmounted&lt;br /&gt;
partitions. So, for example, I would need access to "/dev/sdb" while&lt;br /&gt;
"/dev/sdb1" is mounted.&lt;br /&gt;
      &lt;br /&gt;
  Currently I am using libparted functions but the move is giving me&lt;br /&gt;
corruption when the disk is busy. Would the system call open(pathname,&lt;br /&gt;
flags) work here? If I use open() are there any major gotchas I should&lt;br /&gt;
be aware of? Also, what flags would be a good idea?  I'll need&lt;br /&gt;
O_LARGEFILE and O_NOATIME but I am wondering about O_DIRECT for&lt;br /&gt;
example.&lt;br /&gt;
&lt;br /&gt;
Thank you.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431089/431089/using-system-calls-to-move-data-on-a-disk-with-mounted-partitions/</guid>
      <pubDate>Sun, 27 Jan 2013 13:08:53 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>using open(), etc. to move data on a disk with mounted partitions</title>
      <link>http://www.programmersheaven.com/mb/Linux/431088/431088/using-open-etc-to-move-data-on-a-disk-with-mounted-partitions/</link>
      <description>I need to be able to move data around a disk that has mounted&lt;br /&gt;
partitions on Linux. I am not touching data inside the mounted&lt;br /&gt;
partitions or the MBR, only the free space around it or unmounted&lt;br /&gt;
partitions. So, for example, I would need access to "/dev/sdb" while&lt;br /&gt;
"/dev/sdb1" is mounted.&lt;br /&gt;
      &lt;br /&gt;
  Currently I am using libparted functions but the move is giving me&lt;br /&gt;
corruption when the disk is busy. Would the system call open(pathname,&lt;br /&gt;
flags) work here? If I use open() are there any major gotchas I should&lt;br /&gt;
be aware of? Also, what flags would be a good idea?  I'll need&lt;br /&gt;
O_LARGEFILE and O_NOATIME but I am wondering about O_DIRECT for&lt;br /&gt;
example.&lt;br /&gt;
&lt;br /&gt;
Thank you.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431088/431088/using-open-etc-to-move-data-on-a-disk-with-mounted-partitions/</guid>
      <pubDate>Sun, 27 Jan 2013 13:03:12 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>using open(), etc. to move data on a disk with mounted partitions</title>
      <link>http://www.programmersheaven.com/mb/Linux/431087/431087/using-open-etc-to-move-data-on-a-disk-with-mounted-partitions/</link>
      <description>I need to be able to move data around a disk that has mounted&lt;br /&gt;
partitions on Linux. I am not touching data inside the mounted&lt;br /&gt;
partitions or the MBR, only the free space around it or unmounted&lt;br /&gt;
partitions. So, for example, I would need access to "/dev/sdb" while&lt;br /&gt;
"/dev/sdb1" is mounted.&lt;br /&gt;
      &lt;br /&gt;
  Currently I am using libparted functions but the move is giving me&lt;br /&gt;
corruption when the disk is busy. Would the system call open(pathname,&lt;br /&gt;
flags) work here? If I use open() are there any major gotchas I should&lt;br /&gt;
be aware of? Also, what flags would be a good idea?  I'll need&lt;br /&gt;
O_LARGEFILE and O_NOATIME but I am wondering about O_DIRECT for&lt;br /&gt;
example.&lt;br /&gt;
&lt;br /&gt;
Thank you.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431087/431087/using-open-etc-to-move-data-on-a-disk-with-mounted-partitions/</guid>
      <pubDate>Sun, 27 Jan 2013 12:57:10 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Integration of PyQt/PySide issue</title>
      <link>http://www.programmersheaven.com/mb/Linux/431052/431052/integration-of-pyqtpyside-issue/</link>
      <description>There is an application (Salome) that includes interpretor Python and Qt and PyQt libs.&lt;br /&gt;
 Also there is a module for this application written on Python.&lt;br /&gt;
 Specially for this module we need to include additional version of PyQt or PySide that will be distributed with our module.&lt;br /&gt;
 It doesn’t really matter whether it will be PyQt (commercial, modified with the help of Vendor ID utility) or PySide.&lt;br /&gt;
&lt;br /&gt;
 The problem is when i try to load any of those libs in Salome, i get the next import error message.&lt;br /&gt;
 PyQt: undefined symbol: _ZN10QTableView13doItemsLayoutEv&lt;br /&gt;
 PySide: undefined symbol: _ZN9QMetaType15registerTypedefEPKci &lt;br /&gt;
&lt;br /&gt;
 When importing those modules the same way in test script and running it through interpretor installed in the system everything is working fine.&lt;br /&gt;
&lt;br /&gt;
 Also we tried to recompile the Python 2.6.6 and rebuild PyQt/PySide, but got the same errors.&lt;br /&gt;
&lt;br /&gt;
 Please advise what can cause such problem and how can it be solved.&lt;br /&gt;
&lt;br /&gt;
 P.S: in case with integration of PySide there is another problem: PySide is referring to a lib that has to be located in the system folder&lt;br /&gt;
 /usr/lib/i386-linux-gnu/libpyside-python2.7.so, while in our case all paths should be relative. &lt;br /&gt;
&lt;br /&gt;
 Any help or advice will be appreciated!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431052/431052/integration-of-pyqtpyside-issue/</guid>
      <pubDate>Wed, 23 Jan 2013 01:23:47 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>integration of PyQt/PySide issue</title>
      <link>http://www.programmersheaven.com/mb/Linux/431051/431051/integration-of-pyqtpyside-issue/</link>
      <description>There is an application (Salome) that includes interpretor Python and Qt and PyQt libs.&lt;br /&gt;
 Also there is a module for this application written on Python.&lt;br /&gt;
 Specially for this module we need to include additional version of PyQt or PySide that will be distributed with our module.&lt;br /&gt;
 It doesn’t really matter whether it will be PyQt (commercial, modified with the help of Vendor ID utility) or PySide.&lt;br /&gt;
&lt;br /&gt;
 The problem is when i try to load any of those libs in Salome, i get the next import error message.&lt;br /&gt;
 PyQt: undefined symbol: _ZN10QTableView13doItemsLayoutEv&lt;br /&gt;
 PySide: undefined symbol: _ZN9QMetaType15registerTypedefEPKci &lt;br /&gt;
&lt;br /&gt;
 When importing those modules the same way in test script and running it through interpretor installed in the system everything is working fine.&lt;br /&gt;
&lt;br /&gt;
 Also we tried to recompile the Python 2.6.6 and rebuild PyQt/PySide, but got the same errors.&lt;br /&gt;
&lt;br /&gt;
 Please advise what can cause such problem and how can it be solved.&lt;br /&gt;
&lt;br /&gt;
 P.S: in case with integration of PySide there is another problem: PySide is referring to a lib that has to be located in the system folder&lt;br /&gt;
 /usr/lib/i386-linux-gnu/libpyside-python2.7.so, while in our case all paths should be relative. &lt;br /&gt;
&lt;br /&gt;
 Any help or advice will be appreciated!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/431051/431051/integration-of-pyqtpyside-issue/</guid>
      <pubDate>Wed, 23 Jan 2013 01:14:50 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Re: Programming for Linux</title>
      <link>http://www.programmersheaven.com/mb/Linux/429504/430009/re-programming-for-linux/#430009</link>
      <description>No, because everybody has a Windows Machine and I am sure that a program written for Windows will work everywhere. For Linux is not the same. I know.&lt;br /&gt;
www.denisgottardello.it&lt;br /&gt;
Skype: mrdebug&lt;br /&gt;
Videosurveillance and home automation! &lt;br /&gt;
&lt;a href="http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php"&gt;http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php&lt;/a&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/429504/430009/re-programming-for-linux/#430009</guid>
      <pubDate>Tue, 30 Oct 2012 13:54:01 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Re: Programming for Linux</title>
      <link>http://www.programmersheaven.com/mb/Linux/429504/430006/re-programming-for-linux/#430006</link>
      <description>No, because everybody has a Windows Machine and I am sure that a program written for Windows will work everywhere. For Linux is not the same. I know.&lt;br /&gt;
www.denisgottardello.it&lt;br /&gt;
Skype: mrdebug&lt;br /&gt;
Videosurveillance and home automation! &lt;br /&gt;
&lt;a href="http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php"&gt;http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php&lt;/a&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/429504/430006/re-programming-for-linux/#430006</guid>
      <pubDate>Tue, 30 Oct 2012 13:48:35 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>[deleted]</title>
      <link>http://www.programmersheaven.com/mb/Linux/429634/429634/deleted/</link>
      <description>[duplicate]</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/429634/429634/deleted/</guid>
      <pubDate>Tue, 25 Sep 2012 12:29:55 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Best Video Conferencing solution for Us?</title>
      <link>http://www.programmersheaven.com/mb/Linux/429633/429633/best-video-conferencing-solution-for-us/</link>
      <description>We are trying to integrate a simple Video Conferencing (open source) solution into our existing application which is written in C++ and it runs on Linux.&lt;br /&gt;
&lt;br /&gt;
I am currently looking at using Ekiga (formely known as GnomeMeeting) or Homer Conferencing (short: Homer).&lt;br /&gt;
&lt;br /&gt;
My plan is to "integrate" an existing Video Conferencing client into our existing software.&lt;br /&gt;
&lt;br /&gt;
Please give me recommendation on which 3rd party application or library to use to add video conferencing feature to our application.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/429633/429633/best-video-conferencing-solution-for-us/</guid>
      <pubDate>Tue, 25 Sep 2012 12:26:50 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Programming for Linux</title>
      <link>http://www.programmersheaven.com/mb/Linux/429504/429504/programming-for-linux/</link>
      <description>Why do you feel people only program for Windows or Macintosh? Is it because they don't want to release their source code, lack of knowledge of alternative operating systems?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/429504/429504/programming-for-linux/</guid>
      <pubDate>Wed, 12 Sep 2012 16:33:14 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Re: __attribute__ in C programing</title>
      <link>http://www.programmersheaven.com/mb/Linux/58082/428935/re-__attribute__-in-c-programing/#428935</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I have just noticed that all my files have the attribute C. I've been running XP on the machine for several years, and I never noticed that before.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/58082/428935/re-__attribute__-in-c-programing/#428935</guid>
      <pubDate>Wed, 27 Jun 2012 02:17:51 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Re: __attribute__ in C programing</title>
      <link>http://www.programmersheaven.com/mb/Linux/58082/428934/re-__attribute__-in-c-programing/#428934</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I have just noticed that all my files have the attribute C. I've been running XP on the machine for several years, and I never noticed that before.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.hyphentechnologies.in/website-designing.php"&gt;Website Design Company&lt;/a&gt; | &lt;a href="http://www.hyphentechnologies.in/graphic-designing.php"&gt;Graphics Design Services&lt;/a&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/58082/428934/re-__attribute__-in-c-programing/#428934</guid>
      <pubDate>Wed, 27 Jun 2012 02:15:59 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Semaphore aquiring issue in a Process,which is spawned by other proc</title>
      <link>http://www.programmersheaven.com/mb/Linux/427807/427807/semaphore-aquiring-issue-in-a-processwhich-is-spawned-by-other-proc/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I am building a system where a script will start one process (suppose the process name is procA). This procA will in turn spawn another process (procB) through execv(). The environment is Linux and the coding language used is C/C++.&lt;br /&gt;
&lt;br /&gt;
If the script content is "./procA &amp;amp;" means if procA is started in background, procB (which is spawned by procA) does not starts properly. That happens because procB while starting tries to get a semaphore, which it could not get and hangs there. This is the first place where it tries to get that semaphore so no possibility of the semaphore to be locked by someone else.&lt;br /&gt;
&lt;br /&gt;
Even strange is, when the script content is "./procA" means procA is started in foreground, this problem does not arise and procB starts properly. Its also able to get that semaphore.&lt;br /&gt;
&lt;br /&gt;
Can some one please help??&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
viv2012&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/427807/427807/semaphore-aquiring-issue-in-a-processwhich-is-spawned-by-other-proc/</guid>
      <pubDate>Thu, 08 Mar 2012 20:52:52 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Semaphore aquiring issue in a Process,which is spawned by other proc</title>
      <link>http://www.programmersheaven.com/mb/Linux/427806/427806/semaphore-aquiring-issue-in-a-processwhich-is-spawned-by-other-proc/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I am building a system where a script will start one process (suppose the process name is procA). This procA will in turn spawn another process (procB) through execv(). The environment is Linux and the coding language used is C/C++.&lt;br /&gt;
&lt;br /&gt;
If the script content is "./procA &amp;amp;" means if procA is started in background, procB (which is spawned by procA) does not starts properly. That happens because procB while starting tries to get a semaphore, which it could not get and hangs there. This is the first place where it tries to get that semaphore so no possibility of the semaphore to be locked by someone else.&lt;br /&gt;
&lt;br /&gt;
Even strange is, when the script content is "./procA" means procA is started in foreground, this problem does not arise and procB starts properly. Its also able to get that semaphore.&lt;br /&gt;
&lt;br /&gt;
Can some one please help??&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
viv2012&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/427806/427806/semaphore-aquiring-issue-in-a-processwhich-is-spawned-by-other-proc/</guid>
      <pubDate>Thu, 08 Mar 2012 20:51:01 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>linux newbie</title>
      <link>http://www.programmersheaven.com/mb/Linux/427312/427312/linux-newbie/</link>
      <description>I'm working in a automation company since 5 yrs..I've experience in micro controller embedded c programming..now I want to learn Linux and RTOS programming...from where I can start..is there any good book for it.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/427312/427312/linux-newbie/</guid>
      <pubDate>Thu, 09 Feb 2012 01:15:29 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>bind fails on socket</title>
      <link>http://www.programmersheaven.com/mb/Linux/427012/427012/bind-fails-on-socket/</link>
      <description>Hi! Here's my problem: I create, bind, set to listen a TCP socket (non-blocking mode). Then client connects, I accept connection, data is transferred properly. Now if client first disconnects and only then I close my application (closing data socket, then listening one) I can start this application again (i.e listen on the same port again) without any problems. However if close my application before client disconnects (still closing both data and listening sockets) I can not listen on the same port again for about 30-40 seconds (bind fails, system says port in use). After 30-40 seconds I can listen again. I use shutdown and close to close sockets and always first close data socket and only then listening one. Does anyone know why system thinks that port is still in use if close server application before client disconnects? Client, by the way, detects disconnect and quits too.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/427012/427012/bind-fails-on-socket/</guid>
      <pubDate>Thu, 26 Jan 2012 01:47:24 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>kbhit with up arrow</title>
      <link>http://www.programmersheaven.com/mb/Linux/426782/426782/kbhit-with-up-arrow/</link>
      <description>Since _kbhit is with windows, I have a routine done&lt;br /&gt;
on linux, however, I am not able to get the up arrow&lt;br /&gt;
key ( the one with the command history ) to work properly&lt;br /&gt;
within the console. Please help.&lt;br /&gt;
&lt;br /&gt;
Is there any routine that can retrieve the history when&lt;br /&gt;
the up arrow key is recognized?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/426782/426782/kbhit-with-up-arrow/</guid>
      <pubDate>Wed, 11 Jan 2012 13:11:19 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>Re: __attribute__ in C programing</title>
      <link>http://www.programmersheaven.com/mb/Linux/58082/426078/re-__attribute__-in-c-programing/#426078</link>
      <description>The article is since 2001 but I will answer anyway.&lt;br /&gt;
&lt;br /&gt;
Take for example this code:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
struct Packaging {
    char c;
    int i;
} Packaging;

sizeof(Packaging) will be 8 Bytes.
&lt;/pre&gt;&lt;br /&gt;
or you could do:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
#pragma pack(push)
#pragma pack(1)

struct Packaging {
    char c;
    int i;
} Packaging;

#pragma pack(pop)

sizeof(Packaging) will be 5 Bytes because of aliasing.
&lt;/pre&gt;&lt;br /&gt;
We can use __attribute__ instead of #pragma, like this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
struct Packaging {
    char c;
    int i;
} __attribute__((packed)) Packaging;
&lt;/pre&gt;&lt;br /&gt;
It will have the same effect as pragma.&lt;br /&gt;
And there are a lot of other uses for __attribute__.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/58082/426078/re-__attribute__-in-c-programing/#426078</guid>
      <pubDate>Mon, 05 Dec 2011 01:04:40 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>I have 2 important problems to solve guys!</title>
      <link>http://www.programmersheaven.com/mb/Linux/425371/425371/i-have-2-important-problems-to-solve-guys/</link>
      <description>Hello, &lt;br /&gt;
&lt;br /&gt;
I study Computer Engineering in Poland. I have 2 important problems to solve on Linux Terminal... &lt;br /&gt;
&lt;br /&gt;
1. Write a script which takes input from a user and display on the monitor. It's square.&lt;br /&gt;
    e.g. 5^2 = 25&lt;br /&gt;
    Tip: Use "read" command.&lt;br /&gt;
 &lt;br /&gt;
2. Write a script which verifies your current date and time and if it coincides with your lab classes it should print "I wish you good work!" and if not your lab time must write "Do you rest, go to work!"&lt;br /&gt;
&lt;br /&gt;
I am looking forward to hear good news from you! :) I really have to solve these problems! &lt;br /&gt;
&lt;br /&gt;
Thanks a lot, &lt;br /&gt;
&lt;br /&gt;
Best Regards... &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/425371/425371/i-have-2-important-problems-to-solve-guys/</guid>
      <pubDate>Mon, 24 Oct 2011 13:40:47 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>script on linux terminal</title>
      <link>http://www.programmersheaven.com/mb/Linux/425370/425370/script-on-linux-terminal/</link>
      <description>I want to write a script which calculates square of a number by using read command on Linux. How can i write??? please can anyone help me???&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/425370/425370/script-on-linux-terminal/</guid>
      <pubDate>Mon, 24 Oct 2011 13:40:36 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
    <item>
      <title>app that hashes host's mac address and c.name and submits to server</title>
      <link>http://www.programmersheaven.com/mb/Linux/425099/425099/app-that-hashes-hosts-mac-address-and-cname-and-submits-to-server/</link>
      <description>Hi to all. I want to create a desktop or web app / service that hashes the host's mac address with the computer's name along with other computer attributes (cpu,hdisks,os etc..) and creates an id. Then it sends this id to the server to get stored into a binary file. Now every time the client requests from server , the server gets this generated id from client and authenticates, so it knows it is the same computer. I need to make this in order to create a secure server-client access lock. OS = linux.&lt;br /&gt;
&lt;br /&gt;
I have not done anything similar so any help would be highly appreciated.&lt;br /&gt;
Are there any ready apps-algorithms that would do sth like that?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Linux/425099/425099/app-that-hashes-hosts-mac-address-and-cname-and-submits-to-server/</guid>
      <pubDate>Thu, 06 Oct 2011 02:50:45 -0700</pubDate>
      <category>LINUX programming</category>
    </item>
  </channel>
</rss>