473,804 Members | 3,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wrong args when issuing a SIGUSR1 signal

Hi All,

Say I launch a shell under KDE and start typing:

<code>
$ python
Python 2.4.2 (#10, Feb 16 2006, 17:44:37)
[GCC 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1,
ssp-3.3.5.20050130-1, pie-8.7.7. on linux2
Type "help", "copyright" , "credits" or "license" for
more information.
def fn(a=0,b=0): .... print 'Arguments:',a, b
.... from signal import *
signal(SIGUSR1, fn) </code>

Now, suppose I'm launching a second shell, and typing:

<code>
$ ps ax
... (cut for brevity) ...
5780 pts/2 S+ 0:00 python
5781 pts/1 R+ 0:00 ps ax
$ python
Python 2.4.2 (#10, Feb 16 2006, 17:44:37)
[GCC 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1,
ssp-3.3.5.20050130-1, pie-8.7.7. on linux2
Type "help", "copyright" , "credits" or "license" for
more information. from signal import *
import os
os.kill(5780,SI GUSR1)

</code>

Now, back in the first shell, after pressing <Enter>
once, I get:

<code>
Arguments: 10 <frame object at 0x817f5a4>
</code>

Obviously, I put the two args after experimenting
without them, and receiving an error:

<code>
TypeError: fn() takes no arguments (2 given)
</code>

What is going on here? How should I handle this?

Thanks,
Sorin Schwimmer

_______________ _______________ _______________ _____
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
May 12 '06 #1
0 1112

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2448
by: nowhere | last post by:
Hi, Java 1.4.1: I have a problem using the JNI interface to call some library methods written in java from some C code. The C code uses SIGUSR1 for asynchronous events. However JNI_CreateJVM unblocks SIGUSR1 even if I supply the "-XX:+UseAltSigs" option. The C code relies on the fact that SIGUSR1 is normally blocked and
7
2380
by: José Joye | last post by:
I have a windows service where I create another appdomains. In the newly created AppDomain, I make use of a C library. If I issue an Abort(1) within this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How could I prevent my main AppDomain to stop when the other stopped?Thanks a lot,José
3
3245
by: M Herriott | last post by:
Hello to all - #1: I would have rather used an AND with the choice of newsgroups. I would like to talk to those who subscribe to comp.lang.c++ AND comp.unix.solaris - but I'm stuck with OR. Please accept my sincerest apologies for what I am about to do, I know it is, in the purest sense, incorrect. Having said that much, let me describe my problem. I am running two processes on a Solaris server. Process 1 forks and calls process 2...
42
3469
by: Holger | last post by:
Hi guys Tried searching for a solution to this, but the error message is so generic, that I could not get any meaningfull results. Anyways - errormessage: ---------------------------------------------------- TypeError: addFile() takes exactly 1 argument (2 given) ----------------------------------------------------
0
1089
by: Sori Schwimmer | last post by:
Hi All, I finally put my hands on a GUI-less Linux box and tried the little signal sending experiment. It gives the same! I'm left wondering what is the frame object... Regards, Sorin Schwimmer
1
2075
by: jakebbohio | last post by:
I have a user-defined XPath function implemented using a custom context and the IXsltContextFunction interface. For its arguments, it accepts 3: { XPathResultType.Any, XPathResultType.Any, XPathResultType.String }. The function is called datediff, which converts the arguments to DateTimes, and gives args - args in the units specified by args (e.g., "days", "months"). Anyhow, as an example, Let's say I have the following XML file: ...
3
2919
by: Rainer Borchmann | last post by:
Hi, please can anyone tell me what is wrong with this code ? i have an oszilloskop on the COM1 ,and nothing comes out of it. Rainer VS2005 .............................. private void button1_Click(object sender, EventArgs e) {
1
2490
by: Rob Horton | last post by:
Hi, I've only been using PHP for a short time so there may be a simple solution which I haven't been able to spot yet. here's the line in question: posix_kill($PidSendTo, SIGUSR1); produces the following error: posix_kill() expects parameter 2 to be long, string given in Test.php
0
827
by: pierreroth64 | last post by:
Hi, New with python, I've developped a small cmd line script parsing opts and args with an OptionParser: in myApp.py: ....blablabla... parser.add_option(...) parser.add_option(...)
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.