public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pietro <kpietro@inwind.it>
To: gcc-help@gcc.gnu.org
Subject: Help me
Date: Tue, 13 Feb 2001 10:54:00 -0000	[thread overview]
Message-ID: <4.3.2.7.2.20010213195532.00a9bd70@popmail.inwind.it> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

Hello ML
I have the program for scan ports, in the which there is :

         sin.sin_family=AF_INET;
         sin.sin_port=htons(110);
         sin.sin_addr.s_addr=htonl(counter);
         addr.s_addr=htonl(counter);
         bzero(&(sin.sin_zero),
8);
        
         if
(connect(sock, (struct sockaddr*)&sin, sizeof(sin))==0)
          
{
           
read(sock, buffer, sizeof(buffer));
           if
(strstr(buffer, "QPOP") != NULL)
            
{
               
fprintf(stdout, "FOUND : %s\n", inet_ntoa(addr));
            
}
          }

With gcc -g -oprova prova.c   is ok! 
No error.
When run the program (prova) in the gdb, subsequently line
 if (connect(sock, (struct sockaddr*)&sin,
sizeof(sin))==0)
write the command print connect.
The result is :
$1 = {< text variable, no debug info >} 0x400c9ca0
<__libc_connect>
Why ?
The result of connect no egual -1 (error connecting) or 0 (connecting ok)
?

Help me
Thanks
Ciao by italy


             reply	other threads:[~2001-02-13 10:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-13 10:54 Pietro [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-18 21:03 help me Ali Abdul Ghani
2014-03-18 23:30 ` Andy Falanga (afalanga)
2014-03-19  7:24   ` Ángel González
2014-03-19 19:56     ` Ali Abdul Ghani
2001-02-14 13:31 Help me Pietro
2001-02-13 10:16 David Korn
2001-02-13  9:43 Pietro
2000-05-12  9:54 help me Zille Eizad
2000-05-12 13:18 ` Alexandre Oliva
1999-10-01  0:00 Help me Philipp Thomas
1999-10-01  0:00 ` Jeffrey A Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.3.2.7.2.20010213195532.00a9bd70@popmail.inwind.it \
    --to=kpietro@inwind.it \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).