All of lore.kernel.org
 help / color / mirror / Atom feed
From: snehalphule <snehal@linux.vnet.ibm.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] proposed patch to fix sendmsg01 invalid flags set w/ control ; returned -1 (expected -1), errno 22 (expected 95)
Date: Tue, 03 Feb 2015 14:36:52 +0530	[thread overview]
Message-ID: <54D08FAC.5010601@linux.vnet.ibm.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2368 bytes --]



*Description:*
For bug: https://bugs.launchpad.net/linaro-qa/+bug/1327251
Purpose of Change: Because of code changes in socket.c file for 
32bit-userspace, return value changed to EINVAL in case of 
32bit-userspace/64-bit-kernelspace.
Test changed to check if 32user/64kernel , then return value should be 
checked to EINVAL ,
for other systems return value should be EOPNOTSUPP


Kernel : 3.10.0-123.13.2
Signed-off-by: snehalphule <snehal@linux.vnet.ibm.com>

--- ltp-full-20140828/testcases/kernel/syscalls/sendmsg/sendmsg01.c.orig 
2015-01-23 00:54:22.804582530 -0600
+++ ltp-full-20140828/testcases/kernel/syscalls/sendmsg/sendmsg01.c 
2015-01-23 00:57:26.149032808 -0600
@@ -677,6 +677,38 @@ static void setup4(void)
      control->cmsg_type = SCM_RIGHTS;
      *(int *)CMSG_DATA(control) = tfd;
      controllen = control->cmsg_len;
+
+        // In case of Compact (32bit) user space and 64bit kernel 
space, return value is EINVAL
+        if (tdat[testno].flags == (unsigned)~MSG_CMSG_COMPAT)
+        {
+            char user_space_bit[BUFSIZ];
+            char kernel_arch[BUFSIZ];
+            int kernel_space_bit;
+
+            FILE *pipe = popen("getconf LONG_BIT", "r");
+            if (fgets(user_space_bit, BUFSIZ, pipe) != NULL)
+            {
+               pipe = popen("arch", "r");
+               if (fgets(kernel_arch, BUFSIZ, pipe) != NULL)
+               {
+                   // Remove carriage return from the buffer
+                   size_t len = strlen(user_space_bit);
+                   if (len > 0 && user_space_bit[len-1] == '\n') { 
user_space_bit[--len] = '\0';}
+                   len = strlen(kernel_arch);
+                   if (len > 0 && kernel_arch[len-1] == '\n') { 
kernel_arch[--len] = '\0';}
+
+                   // Check if Kernel used is 64 bit or 32 bit
+                   if (!strcmp(kernel_arch, "ppc64") || 
!strcmp(kernel_arch, "s390x") || !strcmp(kernel_arch, "x86_64"))
+                      kernel_space_bit = 64;
+                   else
+                      kernel_space_bit = 32;
+
+                   // Only if it is Compact user space (32bit), then 
return value is EINVAL
+                   if (atoi(user_space_bit) == 32  && kernel_space_bit 
== 64)
+                   tdat[testno].experrno = EINVAL;
+               }
+            }
+         }
  }

  static void cleanup4(void)




[-- Attachment #1.2: Type: text/html, Size: 4175 bytes --]

[-- Attachment #2: Type: text/plain, Size: 441 bytes --]

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2015-02-03  9:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03  9:06 snehalphule [this message]
2015-02-03  9:37 ` [LTP] proposed patch to fix sendmsg01 invalid flags set w/ control ; returned -1 (expected -1), errno 22 (expected 95) Cyril Hrubis
     [not found]   ` <1501572527.5689680.1422957604905.JavaMail.zimbra@redhat.com>
     [not found]     ` <2062151122.5724081.1422960324625.JavaMail.zimbra@redhat.com>
2015-02-03 12:51       ` Cyril Hrubis

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=54D08FAC.5010601@linux.vnet.ibm.com \
    --to=snehal@linux.vnet.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.